/* New City Church — free resources. One page, one job: pick a book, get the PDF. */

:root {
  --bg: #FCFBF8;
  --surface: #FFFFFF;
  --ink: #14130F;
  --ink-2: #4B4741;
  --ink-3: #7D776D;
  --line: rgba(20,19,15,.13);
  --ok: #2F6B45;
  --err: #A4402F;
  --r: 12px;
  --r-lg: 22px;
  --shadow: 0 1px 2px rgba(20,19,15,.05), 0 12px 32px rgba(20,19,15,.08);
  --shadow-lg: 0 24px 70px rgba(20,19,15,.2);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ease: cubic-bezier(.16,1,.3,1);
}

* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after {
  animation-duration: .001ms !important; transition-duration: .001ms !important; } }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16.5px/1.6 ui-sans-serif, -apple-system, "Segoe UI", Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 22px; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }

/* ------------------------------------------------------------------ header */
.top { border-bottom: 1px solid var(--line); background: rgba(252,251,248,.9);
  backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand svg { width: 34px; height: 34px; color: var(--ink); flex: 0 0 34px; }
.brand b { font-family: var(--serif); font-weight: 400; font-size: 17px; display: block; }
.brand > span > span { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }

/* -------------------------------------------------------------------- hero */
.hero { padding: clamp(44px, 7vw, 84px) 0 clamp(28px, 4vw, 44px); }
.kicker { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--ok); font-weight: 600; }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.4rem); margin-top: 14px; max-width: 16ch; }
.hero .lede { margin-top: 18px; max-width: 54ch; color: var(--ink-2); font-size: clamp(1rem, 1.4vw, 1.12rem); }

/* ----------------------------------------------------------------- library */
.library { padding-bottom: clamp(50px, 8vw, 96px); }
.sec-title { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: clamp(28px, 4vw, 44px) 0 6px; }
.sec-sub { color: var(--ink-2); margin-bottom: 22px; font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2.4vw, 28px); margin-top: 20px; }

.card { text-align: left; display: flex; flex-direction: column; }
.card .shot {
  position: relative; border-radius: var(--r); overflow: hidden; background: #F2F0EA;
  box-shadow: var(--shadow); transition: transform .45s var(--ease), box-shadow .45s var(--ease);
  aspect-ratio: 3/4.3; display: grid; place-items: center;
}
.card .shot img { width: 100%; height: 100%; object-fit: contain; }
.card:hover .shot { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card h3 { font-size: 1.02rem; margin-top: 14px; }
.card .by { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.card .free {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 9px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--ok);
}
.card .free svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ------------------------------------------------------------------- sheet */
.scrim { position: fixed; inset: 0; background: rgba(18,17,13,.5); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; z-index: 50; background: var(--bg); box-shadow: var(--shadow-lg);
  left: 50%; top: 50%; width: min(880px, calc(100% - 32px)); max-height: 90vh;
  transform: translate(-50%, -46%) scale(.98); opacity: 0; pointer-events: none;
  border-radius: var(--r-lg); overflow-y: auto;
  transition: opacity .3s, transform .4s var(--ease);
}
.sheet.on { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.sheet .x {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.92); box-shadow: var(--shadow); transition: background .2s;
}
.sheet .x:hover { background: #fff; }
.sheet .x svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 1.7; }

.detail { display: grid; grid-template-columns: 38% 1fr; gap: clamp(20px, 3vw, 40px); padding: clamp(22px, 3vw, 38px); }
.detail .shot { border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); background: #F2F0EA; }
.detail h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
.detail .sub { font-family: var(--serif); font-style: italic; color: var(--ink-3); margin-top: 7px; }
.detail .by { margin-top: 13px; font-size: 14px; color: var(--ink-2); }
.detail .blurb { margin-top: 15px; color: var(--ink-2); font-size: 15.5px; }
.specs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; color: var(--ink-2); }

/* -------------------------------------------------------------------- form */
.form-head { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-head h3 { font-size: 1.15rem; }
.form-head p { font-size: 14px; color: var(--ink-3); margin-top: 5px; }
.field { margin-top: 14px; }
.field label { display: block; font-size: 12px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 48px; padding: 12px 15px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20,19,15,.07); }
.field input.bad { border-color: var(--err); }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.field .opt { text-transform: none; letter-spacing: 0; color: var(--ink-3); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* country code + number, side by side */
.phone-row { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 10px; }
.phone-row select {
  min-height: 48px; padding: 12px 10px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.phone-row select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20,19,15,.07); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 15px 26px; border-radius: 999px; font-size: 15.5px; font-weight: 500;
  border: 1px solid transparent; transition: transform .3s var(--ease), background .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.ghost { border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.err-msg { color: var(--err); font-size: 14px; margin-top: 12px; }

/* ------------------------------------------------------------------- ready */
.ready { text-align: center; padding: clamp(30px, 5vw, 54px) clamp(20px, 4vw, 44px); }
.ready .tick { width: 66px; height: 66px; border-radius: 50%; background: #E7F0E9;
  display: grid; place-items: center; margin: 0 auto 22px; }
.ready .tick svg { width: 30px; height: 30px; stroke: var(--ok); fill: none; stroke-width: 2; }
.ready h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.ready p { color: var(--ink-2); margin-top: 12px; }
.ready .btn { margin-top: 26px; }
.ready .again { display: block; margin-top: 16px; font-size: 14.5px; color: var(--ink-3);
  text-decoration: underline; background: none; margin-inline: auto; }

/* the giving invitation — warm and visible, but only ever after the book is
   theirs, and never phrased as a condition of anything */
.giving {
  margin-top: 34px; padding: 28px 26px 26px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, #F6F3EC, #FBF9F4);
  border: 1px solid var(--line);
  max-width: 44ch; margin-inline: auto;
}
.giving h3 { font-family: var(--serif); font-size: 1.25rem; }
.giving p { color: var(--ink-2); font-size: 15px; margin-top: 10px; }

.btn.give {
  margin-top: 20px; background: var(--ok); color: #fff; padding: 16px 30px;
  font-size: 16px; box-shadow: 0 6px 18px rgba(47,107,69,.28);
}
.btn.give:hover { background: #27593a; box-shadow: 0 12px 26px rgba(47,107,69,.34); }
.btn.give svg { width: 18px; height: 18px; fill: currentColor; stroke: none; flex: 0 0 18px; }

.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg) } }

/* ------------------------------------------------------------------ toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90;
  display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow-lg); animation: rise .3s var(--ease) both; }
.toast.out { animation: sink .3s ease forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) } }
@keyframes sink { to { opacity: 0; transform: translateY(-6px) } }

/* -------------------------------------------------------------------- foot */
.foot { border-top: 1px solid var(--line); padding: 30px 0 44px; color: var(--ink-3); font-size: 14px; }

/* -------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .detail { grid-template-columns: 1fr; }
  .detail .shot { max-width: 220px; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .two { grid-template-columns: 1fr; }
  .sheet { width: 100%; max-width: none; left: 0; right: 0; bottom: 0; top: auto;
    transform: translateY(100%); border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92vh; }
  .sheet.on { transform: none; }
}
