/* The church history on the home page, told in chapters (index.html #history, assets/js/history-story.js).
   A dark green opening, a gold thread down the middle that fills as you scroll, and chapters that alternate
   sides: a big outlined year, the story, a pull-quote, and a fanned stack of three photos from that era. */

.hs{ position: relative; background: var(--cream); overflow: hidden; }

/* ---------- opening ---------- */
.hs-open{
  position: relative; text-align: center; color: var(--cream);
  padding: clamp(80px, 12vw, 150px) 20px clamp(90px, 12vw, 140px);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(231,200,115,.22), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(0,0,0,.45), transparent 60%),
    var(--green-deep);
}
.hs-open::after{ /* a soft paper edge into the chapters */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 60px;
  background: linear-gradient(to bottom, transparent, var(--cream));
}
.hs-kicker{ font: 700 .8rem/1 var(--font-body); letter-spacing: .32em; text-transform: uppercase; color: var(--gold-bright); margin: 0 0 22px; }
.hs-title{
  font-family: var(--font-display); font-weight: 600; font-style: italic; color: var(--cream);
  font-size: clamp(2.6rem, 7vw, 5.2rem); line-height: 1.02; margin: 0 auto 26px; max-width: 14ch;
}
.hs-lede{ max-width: 640px; margin: 0 auto 14px; font-size: clamp(1.05rem, 1.8vw, 1.25rem); line-height: 1.7; color: rgba(250,243,228,.86); }
.hs-lede-2{ font-family: var(--font-display); font-style: italic; color: var(--gold-bright); font-size: clamp(1.15rem, 2vw, 1.45rem); }
.hs-scroll{ display: inline-block; margin-top: 34px; width: 30px; height: 48px; border: 2px solid rgba(231,200,115,.7); border-radius: 16px; position: relative; z-index: 1; }
.hs-scroll span{ position: absolute; left: 50%; top: 9px; width: 4px; height: 9px; margin-left: -2px; border-radius: 2px; background: var(--gold-bright); animation: hs-wheel 1.8s ease-in-out infinite; }
@keyframes hs-wheel{ 0%{ opacity: 0; transform: translateY(0); } 30%{ opacity: 1; } 100%{ opacity: 0; transform: translateY(16px); } }

/* ---------- the story in numbers ---------- */
.hs-numbers{
  position: relative; z-index: 2; display: grid; grid-template-columns: repeat(5, 1fr);
  max-width: 1040px; margin: -46px auto 0; padding: 0 20px;
}
.hs-numbers > div{
  background: var(--paper, #fffdf7); text-align: center; padding: 22px 10px 18px;
  box-shadow: 0 14px 34px -18px rgba(15,61,46,.45); border-top: 3px solid var(--gold-line);
}
.hs-numbers > div + div{ border-left: 1px solid rgba(201,162,39,.25); }
.hs-numbers > div:first-child{ border-radius: 14px 0 0 14px; }
.hs-numbers > div:last-child{ border-radius: 0 14px 14px 0; }
.hs-numbers b{ display: block; font: 700 clamp(2rem, 4vw, 2.9rem)/1 var(--font-display); color: var(--green-deep); font-variant-numeric: tabular-nums; }
.hs-numbers span{ display: block; margin-top: 8px; font-size: .82rem; line-height: 1.35; color: var(--ink-soft); }

/* ---------- chapters ---------- */
.hs-book{ position: relative; max-width: 1120px; margin: 0 auto; padding: clamp(70px, 9vw, 120px) 20px 40px; }
.hs-thread{ position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(201,162,39,.22); }
.hs-thread i{
  position: absolute; left: 0; top: 0; width: 100%; height: 0;
  background: linear-gradient(to bottom, var(--gold-line), var(--gold-bright));
  box-shadow: 0 0 12px rgba(231,200,115,.8);
}
.hs-thread i::after{ /* the bright bead at the tip */
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: var(--gold-bright); box-shadow: 0 0 0 4px rgba(231,200,115,.25), 0 0 18px var(--gold-bright);
}

.hs-ch{
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 110px);
  align-items: center; margin-bottom: clamp(90px, 12vw, 150px);
}
.hs-ch::before{ /* the knot on the thread */
  content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; background: var(--cream); border: 2px solid var(--gold-line); z-index: 1;
  transition: background .5s, transform .5s;
}
.hs-ch.in::before{ background: var(--gold-bright); transform: scale(1.15); }
.hs-ch:nth-of-type(even) .hs-text{ order: 2; }
.hs-ch:nth-of-type(even) .hs-photos{ order: 1; }

.hs-year{
  position: absolute; top: -0.42em; left: 0; right: 0; text-align: center; pointer-events: none; z-index: 0;
  font: 700 clamp(6rem, 17vw, 13rem)/1 var(--font-display); letter-spacing: -.02em;
  color: transparent; -webkit-text-stroke: 1.5px rgba(201,162,39,.35);
  opacity: 0; transform: translateY(30px); transition: opacity 1.2s ease, transform 1.2s ease;
}
.hs-ch.in .hs-year{ opacity: 1; transform: none; }

.hs-text{ position: relative; z-index: 1; }
.hs-no{ font: 700 .75rem/1 var(--font-body); letter-spacing: .26em; text-transform: uppercase; color: var(--gold-line); margin: 0 0 12px; }
.hs-text h3{ font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.12; margin: 0 0 18px; color: var(--green-deep); }
.hs-text p{ font-size: 1.04rem; line-height: 1.75; color: var(--ink); margin: 0 0 14px; }
.hs-text strong{ color: var(--green-deep); }
.hs-text blockquote{
  margin: 22px 0 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--gold-line);
  font: italic 500 clamp(1.1rem, 1.8vw, 1.3rem)/1.5 var(--font-display); color: var(--green);
}

/* the reveal: text rises, photos fan out */
.hs-text > *{ opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s ease; }
.hs-ch.in .hs-text > *{ opacity: 1; transform: none; }
.hs-ch.in .hs-text > *:nth-child(2){ transition-delay: .08s; }
.hs-ch.in .hs-text > *:nth-child(3){ transition-delay: .16s; }
.hs-ch.in .hs-text > *:nth-child(4){ transition-delay: .24s; }
.hs-ch.in .hs-text > *:nth-child(5){ transition-delay: .36s; }

.hs-photos{ position: relative; z-index: 1; height: clamp(300px, 34vw, 420px); }
.hs-photos img{
  position: absolute; width: 62%; aspect-ratio: 5 / 4; object-fit: cover; box-sizing: border-box;
  padding: 10px 10px 32px; background: #fffdf7; border-radius: 3px; /* a polaroid: the photo sits in its white border */
  box-shadow: 0 18px 40px -16px rgba(36,28,18,.55);
  left: 19%; top: 14%; opacity: 0; transform: rotate(0) scale(.9);
  transition: transform 1s cubic-bezier(.2,.8,.2,1), opacity .8s ease, box-shadow .3s;
}
.hs-ch.in .hs-photos img{ opacity: 1; }
.hs-ch.in .hs-photos img:nth-child(1){ transform: translate(-22%, -8%) rotate(-7deg); }
.hs-ch.in .hs-photos img:nth-child(2){ transform: translate(20%, 16%) rotate(5deg); transition-delay: .12s; }
.hs-ch.in .hs-photos img:nth-child(3){ transform: translate(-2%, 34%) rotate(-2deg); transition-delay: .24s; }
.hs-photos img:hover{ z-index: 5; box-shadow: 0 28px 60px -18px rgba(36,28,18,.7); }
.hs-ch.in .hs-photos img:hover{ transform: translate(0, 10%) rotate(0) scale(1.08); transition-delay: 0s; }

/* the valley: a darker chapter */
.hs-ch-dark{ padding: clamp(40px, 6vw, 70px) clamp(22px, 4vw, 50px); border-radius: 26px; background: linear-gradient(160deg, #13261d, var(--green-deep)); }
.hs-ch-dark::before{ background: #13261d; }
.hs-ch-dark .hs-year{ -webkit-text-stroke-color: rgba(231,200,115,.25); top: -0.3em; }
.hs-ch-dark .hs-text h3, .hs-ch-dark .hs-text strong{ color: var(--gold-bright); }
.hs-ch-dark .hs-text p{ color: rgba(250,243,228,.86); }
.hs-ch-dark .hs-text blockquote{ color: var(--cream); }
.hs-ch-dark .hs-photos img{ filter: grayscale(.35) sepia(.15); }

/* ---------- interlude ---------- */
.hs-interlude{ position: relative; z-index: 1; text-align: center; margin: 0 auto clamp(90px, 12vw, 150px); max-width: 820px; background: var(--cream); padding: 20px 0; }
.hs-interlude p{ font: italic 500 clamp(1.35rem, 2.6vw, 1.9rem)/1.45 var(--font-display); color: var(--green-deep); margin: 0 0 12px; }
.hs-interlude .hs-interlude-2{ font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: var(--ink-soft); }
.hs-strip{ display: flex; justify-content: center; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.hs-strip img{
  width: 110px; height: 110px; object-fit: cover; border-radius: 50%; border: 3px solid #fffdf7;
  box-shadow: 0 10px 24px -12px rgba(36,28,18,.6); filter: sepia(.35);
  transition: filter .4s, transform .4s;
}
.hs-strip img:hover{ filter: none; transform: translateY(-6px) scale(1.06); }

/* ---------- closing ---------- */
.hs-close{
  position: relative; text-align: center; padding: clamp(70px, 10vw, 120px) 20px clamp(80px, 10vw, 120px);
  background: radial-gradient(ellipse at 50% 100%, rgba(231,200,115,.2), transparent 60%), var(--green-deep); color: var(--cream);
}
.hs-close::before{ content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 60px; background: linear-gradient(to top, transparent, var(--cream)); }
.hs-verse{ position: relative; font: italic 600 clamp(1.6rem, 3.8vw, 2.8rem)/1.25 var(--font-display); max-width: 20ch; margin: 0 auto 12px; color: var(--cream); }
.hs-ref{ font: 700 .8rem/1 var(--font-body); letter-spacing: .3em; text-transform: uppercase; color: var(--gold-bright); margin: 0 0 34px; }
.hs-next{ font-size: 1.1rem; color: rgba(250,243,228,.85); margin: 0 0 30px; }
.hs-next em{ color: var(--gold-bright); font-family: var(--font-display); font-size: 1.2em; }
.hs-ctas{ display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hs-close .btn-outline{ border-color: rgba(250,243,228,.6); color: var(--cream); }

/* ---------- phones ---------- */
@media (max-width: 820px){
  .hs-numbers{ grid-template-columns: repeat(3, 1fr); gap: 0; }
  .hs-numbers > div{ border-radius: 0 !important; border-left: 0 !important; }
  .hs-numbers > div:nth-child(1){ border-radius: 14px 0 0 0 !important; }
  .hs-numbers > div:nth-child(3){ border-radius: 0 14px 0 0 !important; }
  .hs-numbers > div:nth-child(4){ grid-column: span 1; border-radius: 0 0 0 14px !important; }
  .hs-numbers > div:nth-child(5){ grid-column: span 2; border-radius: 0 0 14px 0 !important; }
  .hs-thread{ left: 22px; }
  .hs-ch{ grid-template-columns: 1fr; gap: 28px; padding-left: 30px; }
  .hs-ch::before{ left: 3px; top: 8px; } /* on the thread: 22px into the book, whose padding is 20px */
  .hs-ch:nth-of-type(even) .hs-text{ order: 1; }
  .hs-ch:nth-of-type(even) .hs-photos{ order: 2; }
  .hs-year{ text-align: left; left: 30px; top: -0.55em; font-size: clamp(5rem, 24vw, 8rem); }
  .hs-photos{ height: clamp(260px, 70vw, 380px); }
  .hs-photos img{ width: 70%; left: 15%; }
  .hs-ch-dark{ padding: 34px 20px 34px 44px; }
  .hs-ch-dark::before{ left: 3px; }
  .hs-strip img{ width: 76px; height: 76px; }
}

@media (prefers-reduced-motion: reduce){
  .hs-year, .hs-text > *, .hs-photos img{ transition: none !important; }
  .hs-scroll span{ animation: none; }
}
