:root {
  --paper: #f3ead8;
  --paper-deep: #e9dcc2;
  --river: #1f3d36;
  --river-soft: #2f5a4f;
  --clay: #b4532a;
  --ink: #1d2421;
  --ink-muted: #4b544f;
  --rule: rgba(31, 61, 54, 0.22);
  --wj: #a3221c; /* red letters: Jesus's words */

  --font-display: "Fraunces", Georgia, serif;
  --font-text: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.55rem);
  --step-2: clamp(1.6rem, 1.4rem + 1vw, 2.2rem);
  --step-hero: clamp(4.2rem, 2rem + 11vw, 11.5rem);

  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.75rem;
  --space-l: 3rem;
  --space-xl: clamp(4rem, 3rem + 5vw, 8rem);

  --measure: 34rem;
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--font-text);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(180, 83, 42, 0.10), transparent 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(31, 61, 54, 0.12), transparent 60%),
    var(--paper);
}
/* Paper grain: an SVG noise tile, kept faint so text contrast is untouched. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 0 0.22 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--river); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: var(--radius); }

@media (hover: hover) and (pointer: fine) {
  body:not(.smallgroup-page) a:hover { color: var(--clay); }
}

.page {
  position: relative;
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--space-l) clamp(1.25rem, 5vw, 4rem) var(--space-l);
}

/* ---------- Masthead ---------- */
.masthead {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--space-m);
  padding-top: var(--space-xl);
}
.eyebrow {
  margin: 0 0 var(--space-s);
  font: 600 var(--step--1)/1.2 var(--font-text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
}
.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-hero);
  font-weight: 340;
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  line-height: 0.86;
  letter-spacing: -0.035em;
  color: var(--river);
}
.wordmark .dot { color: var(--clay); font-style: normal; }

.coords {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin: 0;
  font: 500 var(--step--1)/1 var(--font-text);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* The river: one hand-drawn line that crosses the page under the name. */
.river {
  display: block;
  width: calc(100% + 8vw);
  margin: var(--space-m) -4vw 0;
  height: auto;
  overflow: visible;
}
.river path {
  fill: none;
  stroke: var(--river-soft);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s forwards;
}
.river path + path { stroke: var(--clay); stroke-width: 1.2; animation-delay: 0.35s; }

.lede {
  max-width: var(--measure);
  margin: var(--space-l) 0 0 auto;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 380;
  font-variation-settings: "opsz" 36;
  line-height: 1.45;
  color: var(--ink);
  animation: rise 0.4s ease-out 0.5s both;
}

/* ---------- Index of what lives here ---------- */
.index {
  margin: var(--space-xl) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.index li {
  display: grid;
  grid-template-columns: 4.5rem minmax(9rem, 16rem) 1fr;
  gap: var(--space-m);
  align-items: baseline;
  padding: var(--space-m) 0;
  border-bottom: 1px solid var(--rule);
}
.index .num {
  font: 300 var(--step-2)/1 var(--font-display);
  font-style: italic;
  color: var(--clay);
}
.index h2 {
  margin: 0;
  font: 500 var(--step-2)/1.1 var(--font-display);
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.015em;
  color: var(--river);
}
.index p { margin: 0; max-width: var(--measure); color: var(--ink-muted); }

/* ---------- Colophon ---------- */
.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-s);
  margin-top: var(--space-xl);
  padding-top: var(--space-m);
  font-size: var(--step--1);
  color: var(--ink-muted);
}
.colophon p { margin: 0; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 640px) {
  .masthead { grid-template-columns: 1fr; padding-top: var(--space-l); }
  .coords { writing-mode: horizontal-tb; transform: none; letter-spacing: 0.16em; }
  .lede { margin-left: 0; }
  .index li { grid-template-columns: 2.75rem 1fr; gap: var(--space-xs) var(--space-s); }
  .index li p { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .river path { animation: none; stroke-dashoffset: 0; }
  .lede { animation: none; }
}

/* ---------- Small group · Conservative evolution ---------- */
.smallgroup-page {
  --paper: #fbf7ee;
  --paper-deep: #f1e8d8;
  --river: #173c35;
  --river-soft: #315f55;
  --clay: #8f3b22;
  --ink: #18231f;
  --ink-muted: #596760;
  --rule: #b9c9c2;
  --wj: #a3221c;
  --font-display: "Crimson Pro", Georgia, serif;
  --font-text: "Atkinson Hyperlegible", "Helvetica Neue", Arial, sans-serif;
  --measure: 42rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  min-height: 100svh;
  overflow-wrap: break-word;
  background:
    radial-gradient(100% 48% at 100% 0, rgb(143 59 34 / 7%), transparent 62%),
    var(--paper);
  font-size: clamp(1rem, 0.98rem + 0.15vw, 1.08rem);
  line-height: 1.65;
}
.smallgroup-page::before { display: none; }
.smallgroup-page ::selection { background: #efd9ae; color: var(--ink); }
.smallgroup-page .page {
  width: min(72rem, 100%);
  padding: calc(1.5rem + env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) calc(2rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
}
.skip-link {
  position: fixed;
  z-index: 2;
  top: max(0.5rem, env(safe-area-inset-top, 0px));
  left: max(0.5rem, env(safe-area-inset-left, 0px));
  padding: 0.7rem 1rem;
  background: var(--river);
  color: var(--paper);
  transform: translateY(-150%);
  transition: transform 140ms var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

.smallgroup-page .masthead {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.smallgroup-page .back {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  color: var(--river);
  font: 700 0.95rem/1 var(--font-text);
  text-decoration: none;
}
.smallgroup-page .wordmark {
  min-width: 0;
  font-family: var(--font-display);
  font-style: normal;
  font-variation-settings: normal;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--river);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.smallgroup-page .wordmark--page { font-size: clamp(3rem, 7vw, 6.5rem); line-height: 0.88; }
.smallgroup-page .wordmark .dot { color: var(--clay); }
.smallgroup-page .coords {
  writing-mode: horizontal-tb;
  transform: none;
  max-width: 12rem;
  color: var(--ink-muted);
  font: 700 0.9rem/1.45 var(--font-text);
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
}
.smallgroup-page .lede {
  max-width: 40rem;
  margin: 2.25rem 0 2.5rem auto;
  color: var(--ink);
  font: 500 clamp(1.25rem, 1.12rem + 0.55vw, 1.55rem)/1.45 var(--font-display);
  animation: none;
  text-wrap: pretty;
}

.smallgroup-page .weeknav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2.5rem;
  padding: 1rem 0;
  border-block: 1px solid var(--rule);
  list-style: none;
}
.smallgroup-page .weeknav a {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid #8fa59b;
  border-radius: 50%;
  color: var(--river);
  font: 600 1.25rem/1 var(--font-display);
  text-decoration: none;
  transition: color 120ms var(--ease-out), background-color 120ms var(--ease-out), transform 120ms var(--ease-out);
}
.smallgroup-page .weeknav a[aria-current] {
  border-color: var(--river);
  background: var(--river);
  color: var(--paper);
}

.featured-week { border-top: 2px solid var(--river); }
.week-archive { margin-top: clamp(4rem, 9vw, 7rem); }
.section-title {
  margin: 0 0 1rem;
  color: var(--river);
  font: 600 clamp(1.65rem, 1.4rem + 0.8vw, 2.25rem)/1.1 var(--font-display);
}
.weeks > .week:first-child { border-top: 1px solid var(--rule); }
.week {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 2rem);
  padding: clamp(2rem, 5vw, 3.25rem) 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}
.featured-week .week { padding-top: 2rem; }
.week .num {
  color: var(--clay);
  font: italic 500 clamp(1.5rem, 1.35rem + 0.6vw, 2rem)/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}
.week-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
}
.week h2 {
  min-width: 0;
  margin: 0;
  color: var(--river);
  font: 600 clamp(2.25rem, 1.8rem + 2vw, 4rem)/0.98 var(--font-display);
  letter-spacing: -0.03em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.tag {
  padding: 0.35rem 0.6rem;
  border-radius: 0.25rem;
  background: var(--clay);
  color: #fff;
  font: 700 0.78rem/1.2 var(--font-text);
  white-space: nowrap;
}
.week .passage, .guide-head .passage { margin: 0.7rem 0 0; color: var(--ink-muted); font-weight: 700; }
.week .idea, .guide-head .idea {
  max-width: 40rem;
  margin: 0.75rem 0 0;
  font: italic 500 clamp(1.25rem, 1.12rem + 0.5vw, 1.5rem)/1.4 var(--font-display);
  text-wrap: pretty;
}
.week h3 {
  margin: 2rem 0 0.5rem;
  color: var(--clay);
  font: 700 1rem/1.25 var(--font-text);
}
.week ul { max-width: var(--measure); margin: 0; padding-left: 1.25rem; color: var(--ink-muted); }
.week li + li { margin-top: 0.5rem; }
.week .challenge { max-width: var(--measure); margin: 0; }
.week > div > details { margin-top: 1rem; }
.smallgroup-page summary {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  cursor: pointer;
  color: var(--river);
  font-weight: 700;
  transition: color 120ms var(--ease-out), transform 120ms var(--ease-out);
}
.smallgroup-page summary:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.reader { max-width: var(--measure); margin-top: 1.5rem; }
.audio-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}
.audio {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 32rem;
  accent-color: var(--river);
}
.speed {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-weight: 700;
}
.speed select {
  min-height: 2.75rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #8fa59b;
  border-radius: 0.25rem;
  background: var(--paper);
  color: var(--river);
  font: 700 1rem/1 var(--font-text);
}
.audio-status { min-height: 1.5em; margin: 0.25rem 0 0; color: var(--clay); font-size: 0.9rem; }
.audio-status:empty { min-height: 0; }
.audio-unavailable, .no-guide {
  margin: 1rem 0 0;
  padding: 0.8rem 0;
  border-block: 1px solid var(--rule);
  color: var(--ink-muted);
}
.reader details.text { margin-top: 0.5rem; }
.verses {
  max-width: var(--measure);
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font: 400 clamp(1.12rem, 1.02rem + 0.3vw, 1.28rem)/1.8 var(--font-display);
}
.verses li {
  display: inline;
  padding: 0.08em 0.12em;
  border-radius: 0.15rem;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-color 160ms var(--ease-out);
}
.verses li[data-start]:not([data-start=""]) { cursor: pointer; }
.verses li[data-start]:not([data-start=""]):focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.verses li.is-reading { background: #f0d6a8; }
.verses li.gap { display: block; margin: 0.5em 0; color: var(--ink-muted); }
.verses sup { color: var(--clay); font: 700 0.65em/1 var(--font-text); }
.wj { color: var(--wj); }
.csb { margin-left: 0.35rem; color: var(--ink-muted); font: 700 0.75em/1 var(--font-text); letter-spacing: 0.08em; }

.guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 1.5rem 0 0;
}
.guide, .pdf {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: 0.65rem 1rem;
  border-radius: 0.25rem;
  font-weight: 700;
  transition: color 120ms var(--ease-out), background-color 120ms var(--ease-out), transform 120ms var(--ease-out);
}
.guide { background: var(--river); color: var(--paper); text-decoration: none; }
.pdf { color: var(--river); }
.guide:active, .pdf:active, .weeknav a:active, .back:active, summary:active { transform: scale(0.98); }

.series-complete {
  max-width: 42rem;
  padding: 1.5rem 0;
  border-block: 2px solid var(--river);
}
.series-complete h2 { margin: 0; color: var(--river); font: 600 clamp(2rem, 1.7rem + 1vw, 3rem)/1 var(--font-display); }
.series-complete p { margin: 0.75rem 0 0; }

/* Preparation guides */
.guide-head { max-width: 48rem; padding-top: 1.5rem; }
.guide-context { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin: 0 0 1.5rem; color: var(--ink-muted); font-size: 0.95rem; }
.wordmark--guide { font-size: clamp(3rem, 7vw, 5.5rem); line-height: 0.95; }
.guide-body { max-width: 42rem; margin-top: clamp(3rem, 7vw, 5rem); }
.guide-body p { margin: 0 0 1em; }
.guide-body h2 { margin: 4rem 0 1rem; color: var(--river); font: 600 clamp(1.8rem, 1.5rem + 1vw, 2.5rem)/1.1 var(--font-display); letter-spacing: -0.02em; text-wrap: balance; }
.guide-body h2:first-child { margin-top: 0; }
.guide-body h3 { margin: 2.5rem 0 0.5rem; color: var(--clay); font: 700 1rem/1.3 var(--font-text); }
.callout { margin: 2rem 0; padding: 1.25rem 1.5rem; border-radius: 0.4rem; background: var(--paper-deep); }
.callout p:last-child { margin-bottom: 0; }
.callout em, .callout-label + p { font-family: var(--font-display); font-size: 1.1em; }
.callout-label { margin: 0 0 0.4em !important; color: var(--clay); font: 700 0.9rem/1.3 var(--font-text); }
.callout .prompt { font: 500 1.08em/1.5 var(--font-display); }
.write-space { height: 4.5rem; margin: 0 0 1em; border-bottom: 1px dashed var(--rule); }
.answer-label { margin: 1.5em 0 0; color: var(--ink-muted); font: 600 0.95rem/1.3 var(--font-text); }
.answer-label + .write-space { height: 7rem; border: 1px dashed var(--rule); border-radius: 8px; margin-top: 0.5em; }
.blank { display: inline-block; width: min(6rem, 100%); border-bottom: 1px solid var(--ink-muted); }
.guide-links--end { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.smallgroup-page .colophon { margin-top: clamp(4rem, 8vw, 7rem); border-top: 1px solid var(--rule); }
.smallgroup-page .credit { max-width: 48rem; }

.smallgroup-page button,
.smallgroup-page a,
.smallgroup-page summary,
.smallgroup-page select {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.smallgroup-page [role="button"] { touch-action: manipulation; }

@media (hover: hover) and (pointer: fine) {
  .smallgroup-page .guide:hover { background: var(--clay); color: #fff; }
  .smallgroup-page .pdf:hover, .smallgroup-page .back:hover, .smallgroup-page summary:hover { color: var(--clay); }
  .smallgroup-page .weeknav a:hover { border-color: var(--clay); color: var(--clay); transform: translateY(-1px); }
  .smallgroup-page .weeknav a[aria-current]:hover { color: var(--paper); }
}

@media (max-width: 680px) {
  .smallgroup-page .page { padding-inline: max(1rem, env(safe-area-inset-left, 0px)) max(1rem, env(safe-area-inset-right, 0px)); }
  .smallgroup-page .masthead { grid-template-columns: 1fr; gap: 0.5rem; padding-top: 0.5rem; }
  .smallgroup-page .wordmark--page { font-size: clamp(2.6rem, 13vw, 4rem); line-height: 0.94; }
  .smallgroup-page .coords { max-width: none; }
  .smallgroup-page .lede { margin: 1.75rem 0 2rem; }
  .week { grid-template-columns: 1fr; gap: 0.6rem; }
  .week-title-row { grid-template-columns: minmax(0, 1fr); }
  .tag { width: fit-content; }
  .week h2 { font-size: clamp(2.15rem, 12vw, 3.3rem); }
  .audio-tools { grid-template-columns: minmax(0, 1fr); }
  .audio { max-width: none; }
  .speed { justify-self: start; }
  .guide-links { align-items: stretch; flex-direction: column; }
  .guide, .pdf { justify-content: center; text-align: center; }
}

@media (pointer: coarse) {
  .smallgroup-page input, .smallgroup-page textarea, .smallgroup-page select { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .smallgroup-page *, .smallgroup-page *::before, .smallgroup-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
