/* Selah on the web: paper, ink and gold, like the app. */
:root {
  --paper: #F3E8D3;
  --card: #F8F3EA;
  --ink: #2A2421;
  --ink-soft: rgba(42, 36, 33, 0.72);
  --gold: #D9B24C;
  --clay: #E7A283;
  --leaf: #3D6B45;
  --rule: rgba(42, 36, 33, 0.14);
  --shadow: 0 18px 40px rgba(42, 36, 33, 0.12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1A1F2B;
    --card: #232A38;
    --ink: #EFE7D6;
    --ink-soft: rgba(239, 231, 214, 0.72);
    --gold: #E2BD62;
    --clay: #D98A6A;
    --leaf: #A9C29A;
    --rule: rgba(239, 231, 214, 0.16);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 20px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 36px 16px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}
a { color: inherit; }

.wordmark { font-weight: 500; letter-spacing: 0.4em; font-size: 16px; margin: 0; }
.eyebrow {
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); margin: 0;
}
h1 { font-weight: 500; font-size: 42px; line-height: 1.1; margin: 0; }
.lede { font-style: italic; font-size: 22px; color: var(--ink-soft); margin: 0; }
.small {
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 13px; color: var(--ink-soft); margin: 0;
}

/* The arched engraving, as in the app. */
.arch {
  width: min(260px, 70vw);
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px 6px 6px;
  overflow: hidden;
  border: 2px solid var(--gold);
  padding: 6px;
  background: var(--card);
}
.arch img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px 999px 3px 3px; display: block; }

.card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: var(--shadow);
}
.verse { font-size: 26px; line-height: 1.35; margin: 0; }
.ref { font-family: -apple-system, system-ui, sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; margin: 12px 0 0; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 26px; border-radius: 999px; border: 0;
  font-family: -apple-system, system-ui, sans-serif; font-size: 16px; font-weight: 600;
  background: var(--ink); color: var(--paper); text-decoration: none; cursor: pointer;
}
.button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.button:disabled { opacity: 0.5; cursor: default; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* The gift: a sealed envelope that opens. */
.envelope {
  position: relative; width: 100%; aspect-ratio: 3 / 2; max-width: 420px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 18px;
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer;
  transition: transform 0.6s ease, opacity 0.6s ease;
}
.envelope::before {  /* the flap */
  content: ""; position: absolute; inset: 0 0 45% 0;
  background: linear-gradient(to bottom right, transparent 49.5%, var(--rule) 50%, transparent 50.5%),
              linear-gradient(to bottom left, transparent 49.5%, var(--rule) 50%, transparent 50.5%);
  background-size: 50% 100%; background-position: left, right; background-repeat: no-repeat;
}
.envelope .to { position: absolute; left: 0; right: 0; bottom: 18%; font-size: 24px; }
.seal {
  position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%);
  width: 76px; height: 76px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #F0CD72, var(--gold) 60%, #A8842E);
  color: #2A2421; display: grid; place-items: center; font-size: 30px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.envelope.opening { transform: scale(0.92) translateY(-12px); opacity: 0; }

.prayer { opacity: 0; transform: translateY(12px); transition: opacity 0.9s ease, transform 0.9s ease; }
.prayer.shown { opacity: 1; transform: none; }
.prayer .body { font-size: 24px; line-height: 1.45; white-space: pre-wrap; margin: 0; }
.from { font-style: italic; color: var(--ink-soft); margin: 14px 0 0; }

.play {
  display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 24px 0 10px;
  border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink);
  font-family: -apple-system, system-ui, sans-serif; font-size: 15px; font-weight: 600; cursor: pointer;
}
.play .dot { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; }

form.reply { width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; }
form.reply input, form.reply textarea {
  width: 100%; font: inherit; font-size: 20px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px;
}
form.reply textarea { min-height: 130px; resize: vertical; }
.notice { font-family: -apple-system, system-ui, sans-serif; font-size: 14px; margin: 0; }
.notice.error { color: #B4432A; }
.hidden { display: none !important; }

footer { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  .envelope, .prayer { transition: none; }
}
