/* I Will Pray For You: sky theme. Pure CSS plus one small SVG (clouds.svg); no fonts or remote files. */
:root {
  --ink: #12263a;
  --muted: #3f566d;
  --accent: #1a5ba6;
  --accent-dark: #124580;
  --accent-ink: #ffffff;
  --gold: #e3a92f;
  --line: rgba(26, 91, 166, 0.22);
  --card: rgba(255, 255, 255, 0.78);
  --ok: #1d6b3f;
  --warn: #7a4b00;
  --bad: #a12b2b;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Titles: a soft, readable script from Google Fonts (display=swap); the stack below is the fallback. */
  --script: "Dancing Script", "Snell Roundhand", "Segoe Script", Georgia, "Times New Roman", serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { background: #bfe0f8; }

body {
  margin: 0;
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}

/* ---- Sky: gradient and sun glow (body::before), sunbeams (body::after), clouds (html::after) ---- */
body::before,
body::after,
html::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  height: 100lvh; /* the LARGE viewport: does not resize when a phone's address bar hides or shows, so nothing jumps */
  width: 100%;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background:
    radial-gradient(circle at 50% -7%, rgba(255, 207, 77, 0.7) 0, rgba(255, 214, 102, 0.42) 9%, rgba(255, 223, 130, 0.18) 22%, rgba(255, 223, 130, 0) 40%),
    radial-gradient(ellipse 70% 38% at 50% -4%, rgba(255, 250, 226, 0.9), rgba(255, 250, 226, 0) 100%),
    linear-gradient(to bottom, #3f93e2 0%, #66adef 30%, #9fcdf5 62%, #d6ebfb 88%, #eef7fe 100%);
}
body::after {
  background: repeating-conic-gradient(from 168deg at 50% -6%, rgba(255, 247, 214, 0.26) 0deg 3deg, rgba(255, 247, 214, 0.04) 3deg 5deg, rgba(255, 247, 214, 0) 5deg 11deg);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 85%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 85%);
}
html::after {
  width: calc(100% + 1200px);
  background: url("/clouds.svg") repeat-x 0 100% / 1200px 600px;
}
/* The slow cloud drift runs on mouse/trackpad devices only. On phones it keeps the page repainting while the
   person scrolls, which adds to scroll jank and competes with the captcha widget for the GPU. */
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  html::after { animation: drift 240s linear infinite; }
}
@keyframes drift { to { transform: translateX(-1200px); } }

/* ---- Layout ---- */
main { max-width: 40rem; margin: 0 auto; padding: 1rem 1rem 4rem; }
main.wide { max-width: 64rem; }

h1 {
  font-family: var(--script);
  font-weight: 700;
  font-size: clamp(2.3rem, 10vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: 0;
  text-align: center;
  margin: 1.25rem 0 0.5rem;
  color: #0a2a4d;
  /* Soft white halo behind the lettering plus a hairline stroke for a touch more weight: reads on the blue sky. */
  -webkit-text-stroke: 0.5px #0a2a4d;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.95), 0 0 16px rgba(255, 255, 255, 0.9), 0 0 32px rgba(255, 255, 255, 0.75), 0 1px 2px rgba(10, 42, 77, 0.25);
}
/* Page title: one line, as wide as the request form (#form; on pages without one, the main content card).
   fit.js makes it exact. Without JS the size below is used: the form is min(viewport - side padding, 38rem) wide (<main> is 40rem,
   padding 1rem; 0.75rem on phones under 400px), and each title's text is --fit-r times as wide as its font size
   (measured in Dancing Script 700). */
h1.fit {
  font-size: calc(min(100vw - var(--fit-gap, 2rem), 38rem) / var(--fit-r, 12.05));
  line-height: 1.12;
  margin-bottom: calc(0.3em + 1rem); /* 0.3em clears the descenders (p, y); the extra 1rem is the breathing room Scott asked for */
  white-space: nowrap;
  overflow: visible;
}
body[data-page="home"] { --fit-r: 6.85; }
html[lang^="en"] body[data-page="salvation"] { --fit-r: 13.7; }
html[lang^="es"] body[data-page="salvation"] { --fit-r: 10.95; }
body { overflow-x: clip; }
@media (max-width: 400px) { body { --fit-gap: 1.5rem; } }
body.admin h1 { font-family: var(--sans); font-size: clamp(1.9rem, 7vw, 2.7rem); line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 1.75rem 0 0.5rem; color: #0f3a6b; }
.card h2 { margin-top: 0; }
/* Text that sits on the sky gets a pale translucent panel so it always reads (about 11:1 contrast). */
.lead {
  text-align: center; color: #0b2a47; margin: 0.25rem auto 1rem; max-width: 34rem; font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.8); border-radius: 16px; padding: 0.6rem 1rem;
}
main.wide h1, main.wide .lead { text-align: left; margin-left: 0; }

.card {
  background: var(--card);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(18, 69, 128, 0.16), 0 1px 3px rgba(18, 69, 128, 0.1);
  padding: 1.1rem 1.25rem;
  margin: 1rem 0;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: rgba(255, 255, 255, 0.92); }
}
/* Touch devices: no live blur behind the cards. Blurring the moving sky on every scroll frame is costly on phones,
   and the form card holds the captcha iframe. A slightly more solid white keeps the same look. */
@media (pointer: coarse) {
  .card { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 255, 255, 0.9); }
}
.card .card { box-shadow: none; background: rgba(227, 240, 252, 0.7); border-color: rgba(26, 91, 166, 0.18); }

/* ---- Navigation pills ---- */
.top { text-align: right; margin: 0.25rem 0 0.5rem; }
.top a, .back a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(18, 69, 128, 0.12);
  color: #0b2f58;
  font-size: 1rem;
  text-decoration: none;
  font-weight: 600;
}
.top a:hover, .back a:hover { background: #fff; }
.back { margin: 0.5rem 0 0; }
.back.more { text-align: center; margin-top: 1.5rem; }

/* ---- Forms ---- */
label { display: block; font-weight: 600; margin: 1rem 0 0.3rem; }
.card > label:first-child, .card > form > label:first-child { margin-top: 0; }
.hint { font-weight: normal; color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; } /* 14.4px at the smallest */

input[type="text"], input[type="number"], input[type="email"], textarea {
  width: 100%;
  font: inherit;
  padding: 0.65rem 0.8rem;
  border: 1px solid #a9c4e0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(18, 69, 128, 0.08);
}
textarea { min-height: 7.5rem; resize: vertical; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid #f2b83b;
  outline-offset: 2px;
}

button, .button {
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  background: linear-gradient(to bottom, #2a73c7, var(--accent));
  color: var(--accent-ink);
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 4px 12px rgba(18, 69, 128, 0.3);
}
button:hover:not(:disabled) { background: linear-gradient(to bottom, #2368b8, var(--accent-dark)); }
button:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
#send { width: 100%; font-size: 1.05rem; }
button.secondary { background: rgba(255, 255, 255, 0.9); color: var(--accent-dark); border: 1px solid #a9c4e0; box-shadow: none; }
button.secondary:hover:not(:disabled) { background: #fff; }
button.danger { background: linear-gradient(to bottom, #b73a3a, var(--bad)); }
button.small { font-size: 0.85rem; min-height: 34px; padding: 0.25rem 0.8rem; box-shadow: none; }

.counter { text-align: right; color: var(--muted); font-size: 0.9rem; }
.counter.over { color: var(--bad); font-weight: bold; }

.msg { padding: 0.7rem 0.9rem; border-radius: 12px; margin: 1rem 0; }
.msg.ok { background: #dff3e6; color: var(--ok); }
.msg.err { background: #fbe4e4; color: var(--bad); }
.msg.info { background: #fff1cf; color: var(--warn); }

/* Honeypot field: kept off screen so people never see it. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Public list ---- */
.week { list-style: none; padding: 0; margin: 0; }
.week li {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--line);
}
.week li:last-child { border-bottom: 0; }
.week li > span:first-child { font-weight: 700; letter-spacing: 0.06em; font-size: 1.05rem; }
.tag {
  text-align: right; font-size: 0.9rem; font-weight: 600; padding: 0.15rem 0.7rem; border-radius: 999px;
  background: #fff1cc; color: var(--warn);
}
.tag.answered { background: #dff3e6; color: var(--ok); }
.tag.prayed { background: #dcebfb; color: var(--accent-dark); }

footer {
  margin: 2.5rem auto 0; max-width: 34rem; text-align: center; color: #0b2a47; font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.8); border-radius: 14px; padding: 0.6rem 1rem;
}
footer a { color: var(--accent-dark); }
a { color: var(--accent); }
.meta { color: var(--muted); font-size: 0.9rem; }

/* ---- Salvation pages: numbered steps, the verse is the most prominent text (same font as the rest of the site) ---- */
.salv { counter-reset: step; }
.salv .card { padding: 1.1rem 1.25rem 1.2rem; }
.salv section.card:not(.next) > h2 {
  counter-increment: step; display: flex; align-items: center; gap: 0.6rem;
  margin: 0 0 0.5rem; font-size: 1.1rem; color: var(--accent-dark);
}
.salv section.card:not(.next) > h2::before {
  content: counter(step); flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 1rem; font-weight: 700;
}
.salv blockquote {
  margin: 0.5rem 0 0.4rem;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 5px solid;
  border-image: linear-gradient(to bottom, #4aa0ec, var(--gold)) 1;
  font: 600 1.3rem/1.45 var(--sans);
  color: #0e2540;
}
.salv blockquote strong { display: block; margin-top: 0.3rem; font: 700 0.95rem var(--sans); letter-spacing: 0.03em; color: var(--accent-dark); }
.salv .card p { margin: 0.5rem 0 0; font-size: 1rem; }
.salv .card .card { font: 600 1.15rem/1.55 var(--sans); margin-bottom: 0; }
.salv .next { text-align: center; }
.salv .next p { text-align: left; }
.salv .next a.button { margin-top: 1rem; font-size: 1.1rem; }

/* ---- Admin ---- */
.bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1rem 0; }
.bar button.active { outline: 3px solid #f2b83b; outline-offset: 1px; }
.req { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0.5rem 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.admin .card { background: rgba(255, 255, 255, 0.92); }
.mt { margin-top: 1rem; }
/* Room for the captcha widget (65px) is kept from the start, so it does not push the button down when it appears. */
#turnstile { min-height: 65px; }
input.narrow { width: 7rem; }
table.stats { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.stats th, table.stats td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); }
table.stats td.num, table.stats th.num { text-align: right; }
details.card summary { cursor: pointer; font-weight: 600; }
.lang { font-size: 0.75rem; background: #dcebfb; color: var(--accent-dark); padding: 0 0.4rem; border-radius: 4px; font-weight: 600; }

@media (max-width: 400px) {
  body { font-size: 16px; }
  main { padding-left: 0.75rem; padding-right: 0.75rem; }
  .card { padding: 1rem; border-radius: 16px; }
  .salv blockquote { font-size: 1.2rem; }
}

/* Pray again (second_round): needs attention */
.attn-banner {
  display: block; width: 100%; text-align: left; margin: 1rem 0 0;
  background: #fff1cc; color: var(--warn); border: 2px solid var(--gold); box-shadow: none; border-radius: 14px;
}
.attn-banner[hidden] { display: none; }
.attn-banner:hover:not(:disabled) { background: #ffe8a8; }
.bar button.attn { background: #fff1cc; color: var(--warn); border: 2px solid var(--gold); }
.admin .card.attn { background: #fff8e1; border: 1px solid var(--gold); border-left: 8px solid var(--gold); }
.flag { font-size: 0.75rem; font-weight: 700; background: var(--gold); color: #3d2600; padding: 0.1rem 0.5rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; }

/* Optional email notices on the form */
/* Prominent Heaven link above the form (the plain link stays at the bottom of the page). */
a.heaven {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 60px; margin: 0.25rem 0 1rem; padding: 0.75rem 1.25rem;
  border-radius: 18px; border: 2px solid #fff;
  background: linear-gradient(to bottom, #ffdf8a, #f2b83b);
  color: #1d2a3a; font-size: 1.2rem; font-weight: 700; line-height: 1.25; text-decoration: none;
  box-shadow: 0 6px 18px rgba(18, 69, 128, 0.25);
}
a.heaven::after { content: "\203A"; margin-left: 0.6rem; font-size: 1.6rem; line-height: 1; }
a.heaven:hover { background: linear-gradient(to bottom, #ffe7a8, #f5c04e); }

/* ---- Prayer list card ---- */
.list-card h2 { margin: 0; }
.list-card > .meta { margin: 0.25rem 0 0.5rem; }
.empty { margin: 0.75rem 0; padding: 0.8rem 1rem; border-radius: 12px; background: rgba(255, 241, 204, 0.7); color: #5a3a00; font-size: 1rem; text-align: center; }
.empty[hidden], .tally[hidden] { display: none; }
.tally {
  display: flex; align-items: center; gap: 0.75rem; margin: 0.75rem 0 0; padding: 0.7rem 1rem;
  border-radius: 14px; background: #dff3e6; color: #14502f; font-size: 1.1rem; font-weight: 700;
}
.tally .n { font-size: 2.2rem; line-height: 1; font-weight: 800; }
.praise-box h2 { margin-top: 0; }

.group-title { font-weight: 600; margin: 0.25rem 0 0; }
.notices { margin-top: 1.25rem; padding-top: 0.25rem; border-top: 1px solid var(--line); }
.notices[hidden] { display: none; }
label.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; margin: 0.75rem 0 0; cursor: pointer; }
label.check input { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; flex: none; accent-color: var(--accent); }
.lead-thanks { font: 1.2rem/1.6 var(--serif); font-style: italic; color: #0f3a6b; }
.praise-list { list-style: none; margin: 0; padding: 0; }
.praise-list li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.praise-list li:last-child { border-bottom: 0; }
.praise-list q { quotes: none; display: block; white-space: pre-wrap; }
.praise-list .by { display: block; margin-top: 0.2rem; font-size: 0.85rem; font-weight: 600; opacity: 0.8; }
.praise { margin: 0.5rem 0; padding: 0.5rem 0.75rem; border-radius: 10px; background: #dff3e6; color: #174f2f; overflow-wrap: anywhere; white-space: pre-wrap; }
.settings-head { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
a.translate { margin-left: 0.4rem; font-size: 0.85em; white-space: nowrap; }
