/* Mx4Christ. Colors come straight from the logo: black, white and cross red. */
@font-face {
  font-family: "Oswald";
  src: url("assets/fonts/oswald.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("assets/fonts/barlow-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("assets/fonts/barlow-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg: #0e0e10;
  --surface: #18181b;
  --line: #2c2c31;
  --text: #f4f4f2;
  --muted: #b4b4ba;
  --red: #ce0f2d;
  --red-hover: #e0183a;
  --tile: #e9e9e6;
  --ink: #0e0e10;
  --r: 0px;
  --nav-h: 72px;
  --strip-h: 36px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font: 400 1.0625rem/1.6 "Barlow", system-ui, sans-serif;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
svg { width: 1.2em; height: 1.2em; flex: none; }

h1, h2, h3 {
  margin: 0;
  font-family: "Oswald", "Barlow", sans-serif;
  font-weight: 700;
  font-style: italic;
  line-height: 1.1;
  text-wrap: balance;
}
h1 { font-size: clamp(2.75rem, 6.6vw, 5.75rem); }
.accent {
  color: #e8243f;
  background: linear-gradient(100deg, #c40d2a, #f4475f);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Extra room so the gradient covers the slanted last letter; the negative margin keeps word spacing the same */
  display: inline-block;
  padding: .04em .24em .04em .04em;
  margin: -.04em -.2em -.04em -.04em;
}
h2 { font-size: clamp(2.1rem, 4vw, 3.4rem); }
p { margin: 0; max-width: 60ch; }

.wrap { width: min(100% - 2.5rem, 1600px); margin-inline: auto; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 30;
  padding: 10px 16px; background: var(--text); color: var(--ink); border-radius: var(--r);
}
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; border-radius: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 52px; padding: 0 26px;
  border: 1px solid transparent; border-radius: var(--r);
  font: 500 1.0625rem/1 "Oswald", sans-serif;
  text-decoration: none; white-space: nowrap;
  transition: background-color .2s, border-color .2s, transform .2s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn svg { transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: var(--red-hover); }
.btn--ghost { border-color: var(--red); color: var(--text); }
.btn--ghost:hover { border-color: var(--red); background: var(--red); color: #fff; }
.btn--sm { min-height: 42px; padding: 0 20px; font-size: 1rem; }
.btn--main {
  position: relative; overflow: hidden;
  min-height: 60px; padding: 0 34px; font-size: 1.2rem;
}

/* Red strip across the very top */
.strip {
  display: flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--strip-h); padding: 4px 16px;
  background: var(--red); color: #fff;
  font: 500 .95rem/1.2 "Oswald", sans-serif; letter-spacing: .04em; text-transform: uppercase;
  text-decoration: none; text-align: center;
  transition: background-color .2s;
}
.strip:hover { background: var(--red-hover); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
}
.nav__inner {
  width: min(100% - 2.5rem, 1600px); margin-inline: auto;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav__logo img { width: 176px; height: auto; }
.nav__menu, .nav__links { display: flex; align-items: center; }
.nav__links { gap: 8px; }
.nav__menu a {
  font-family: "Oswald", sans-serif; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
}
.nav__links a {
  padding: 8px 14px; border-radius: var(--r);
  text-decoration: none; color: var(--text);
  transition: background-color .2s;
}
.nav__links a:hover { background: rgb(255 255 255 / .12); }
/* Logo left, links centered, Donate right */
@media (min-width: 901px) {
  .nav__inner { display: grid; grid-template-columns: 1fr auto 1fr; }
  .nav__menu { display: contents; }
  .nav__menu .btn { justify-self: end; }
}
.nav__toggle {
  display: none; width: 46px; height: 46px; padding: 0; place-items: center;
  background: none; border: 1px solid var(--line); border-radius: var(--r);
  color: var(--text); font-size: 1.25rem; cursor: pointer;
}
.nav__toggle span { display: grid; place-items: center; }
.nav__icon-close { display: none !important; }
.nav__toggle[aria-expanded="true"] .nav__icon-open { display: none; }
.nav__toggle[aria-expanded="true"] .nav__icon-close { display: grid !important; }

/* Hero: copy on top, panoramic rider photo filling what's left of the screen */
.hero {
  min-height: calc(100dvh - var(--nav-h) - var(--strip-h));
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}
/* Words on the left, starting in line with the rest of the page; the whole rider and bike on the right */
.hero__copy {
  display: flex; align-items: center;
  width: auto; margin: 0;
  padding: 32px clamp(24px, 3vw, 56px) 32px max(1.25rem, calc((100vw - 1600px) / 2));
}
.hero__text h1 { font-size: clamp(2.75rem, 4.6vw, 5.75rem); }
.hero__sub { margin-top: 16px; font-size: clamp(1.0625rem, 1.2vw, 1.3rem); color: var(--muted); }
.hero__cta { margin-top: 28px; }
/* Very large screens: give the heading the room it needs to stay on three lines */
@media (min-width: 2000px) {
  .hero { grid-template-columns: calc((100vw - 1600px) / 2 + 640px) minmax(0, 1fr); }
}
.hero__photo { position: relative; display: block; min-height: 420px; }
.hero__photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 95% 100%; /* bike centered, nothing cut from the bottom */
}

/* Mission */
.mission {
  display: grid; grid-template-columns: 5fr 7fr; align-items: center;
  gap: clamp(32px, 6vw, 88px);
  padding-block: clamp(72px, 10vw, 136px);
}
.mission__text h2 { font-size: clamp(2rem, 3.4vw, 2.9rem); }
.mission__text h2 span { display: block; }
.mission__text p { margin-top: 20px; color: var(--muted); font-size: 1.15rem; }
.mission__photo img { width: 100%; border-radius: var(--r); aspect-ratio: 4 / 3; object-fit: cover; }

/* How we help: the sprocket turns as you scroll */
.how {
  position: relative; overflow: hidden;
  padding-block: clamp(72px, 10vw, 128px);
}
.how__gear {
  position: absolute; right: -14%; top: 50%;
  width: min(62vw, 820px); height: auto; margin-top: calc(min(62vw, 820px) * -0.52);
  opacity: .07; pointer-events: none;
}
.how__inner { position: relative; }
.how__list { margin-top: clamp(32px, 5vw, 56px); }
.how__list li {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: baseline;
  gap: 8px 40px; padding-block: clamp(20px, 3vw, 34px);
  border-top: 1px solid #3a3a40;
}
.how__list h3 { font-size: clamp(2.6rem, 6.5vw, 5.5rem); }
.how__list p { font-size: 1.2rem; color: var(--muted); }
.how__apply {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 48px;
  margin-top: 8px; padding-top: clamp(28px, 4vw, 44px); border-top: 1px solid #3a3a40;
}
.how__apply p { max-width: 52ch; color: var(--text); font-size: 1.15rem; }

/* Merch */
.merch { padding-block: clamp(72px, 10vw, 136px); }
.merch__head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 20px 40px; margin-bottom: clamp(28px, 4vw, 48px);
}
.merch__head p { margin-top: 12px; color: var(--muted); }
.merch__grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
.item--lead { grid-column: span 2; grid-row: span 2; }
/* Home page: all five items the same size in one row, each name and price centered under its item */
.merch__grid .item__meta { flex-direction: column; align-items: center; text-align: center; }
@media (min-width: 641px) {
  .merch__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .merch__grid .item--lead { grid-column: auto; grid-row: auto; }
  .merch__grid .item--lead .item__img img { max-width: none; }
}
.item a { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.item__img {
  flex: 1; display: grid; place-items: center; overflow: hidden;
  padding: clamp(10px, 2vw, 24px);
}
.item__img img {
  width: 100%; max-height: 100%; aspect-ratio: 1; object-fit: contain;
  /* A soft light around each item keeps black clothing visible on the dark page */
  filter: drop-shadow(0 0 14px rgb(255 255 255 / .26));
  transition: transform .5s var(--ease);
}
.item--lead .item__img img { max-width: 640px; }
.item a:hover .item__img img { transform: scale(1.04); }
.item__meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px;
  padding: 12px 2px 4px;
}
.item__name { font-weight: 600; }
.item__price { color: var(--muted); }

/* Verse */
.verse {
  background: linear-gradient(transparent, var(--red) 24%, var(--red) 76%, transparent);
  color: #fff; padding-block: clamp(72px, 7vw, 104px);
}
.verse figure { margin-block: 0; }
.verse blockquote {
  margin: 0; text-wrap: balance;
  font: italic 700 clamp(1.4rem, 2.5vw, 2.75rem)/1.16 "Oswald", sans-serif;
}
/* Verses flip sideways: the current one up front, the next one faint to its right.
   They share one spot, so the band keeps the height of the longest verse and never jumps. */
.verse { overflow: hidden; }
.verse__stack { position: relative; display: grid; align-items: center; }
.verse__item {
  grid-area: 1 / 1; width: 58%; margin: 0; opacity: 0;
  transform-origin: left center;
  transition: opacity .8s cubic-bezier(0.2, 0.8, 0.2, 1), transform .8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.verse__item.is-on { opacity: 1; transform: none; }
.verse__item.is-next { opacity: .16; transform: translateX(calc(100% + 48px)) scale(.8); }
.verse__item.is-leaving { opacity: 0; transform: perspective(900px) translateX(-48px) rotateY(24deg); }
.verse__item.is-entering { opacity: 0; transition: none; }
@media (max-width: 640px) {
  .verse__item { width: 80%; }
  .verse__item.is-next { transform: translateX(calc(100% + 20px)) scale(.8); }
}
.verse figcaption { margin-top: 14px; font-weight: 600; font-size: 1.05rem; }

/* Donate */
.donate {
  display: grid; grid-template-columns: 7fr 5fr; align-items: center;
  gap: clamp(32px, 6vw, 88px);
  padding-block: clamp(72px, 10vw, 136px);
}
.donate__photo img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; border-radius: var(--r); }
.donate__text > p:first-of-type { margin-top: 20px; font-size: 1.15rem; color: var(--muted); }
.donate__list { margin: 16px 0 28px; display: grid; gap: 12px; }
.donate__list li { display: flex; align-items: center; gap: 12px; font-size: 1.1rem; font-weight: 600; }
.donate__list svg { font-size: 1.2rem; }
.donate__note { margin-top: 14px; font-size: .95rem; color: var(--muted); }

/* Footer */
.footer { padding-block: 56px 28px; }
.footer__inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; align-items: start; }
.footer__logo { width: min(240px, 100%); }
.footer h2 { font-size: 1.15rem; }
.footer__links { margin-top: 14px; display: grid; gap: 4px; }
.footer__links a {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px;
  color: var(--muted); text-decoration: none; overflow-wrap: anywhere;
  transition: color .2s;
}
.footer__links a:hover { color: var(--text); }
.footer__legal { margin-top: 40px; color: var(--muted); font-size: .95rem; max-width: none; }

.mission__more { margin-top: 24px; }
.meet__invite { margin-top: 32px; }
.meet__invite a { color: var(--text); }

/* Merch and Meet Us pages */
.page { padding-block: clamp(32px, 5vw, 72px) clamp(72px, 9vw, 120px); }
.page h1 { font-size: clamp(2.75rem, 6vw, 5.5rem); }
.page__lead { margin-top: 16px; font-size: clamp(1.0625rem, 1.2vw, 1.3rem); color: var(--muted); }
.page__cta { margin-top: 32px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 32px; }
.shop-buy { width: 100%; margin-top: 10px; }
.gallery { columns: 3; column-gap: 16px; margin-top: 32px; }
.gallery img { width: 100%; margin-bottom: 16px; break-inside: avoid; }
@media (max-width: 900px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .gallery { columns: 2; }
}
@media (max-width: 640px) {
  .gallery { columns: 1; }
  .page__cta .btn { width: 100%; }
}

/* All-caps headlines and buttons */
h1, h2, h3, .verse blockquote, .btn { text-transform: uppercase; }

/* Background glow. It's fixed to the screen, so it looks the same at every scroll position. */
:root { --glow-1: rgb(206 15 45 / .2); --glow-2: rgb(206 15 45 / .15); }
body::before, body::after {
  content: ""; position: fixed; inset: -15%; z-index: -1; pointer-events: none;
  will-change: transform;
}
body::before {
  background:
    radial-gradient(38% 36% at 14% 16%, var(--glow-1), transparent 72%),
    radial-gradient(36% 38% at 88% 44%, var(--glow-1), transparent 72%),
    radial-gradient(40% 36% at 22% 88%, var(--glow-1), transparent 72%);
}
body::after {
  background:
    radial-gradient(34% 32% at 62% 10%, var(--glow-2), transparent 72%),
    radial-gradient(34% 36% at 8% 54%, var(--glow-2), transparent 72%),
    radial-gradient(38% 34% at 78% 90%, var(--glow-2), transparent 72%);
}
@media (prefers-reduced-motion: no-preference) {
  body::before { animation: glow-drift-1 46s ease-in-out infinite alternate; }
  body::after { animation: glow-drift-2 58s ease-in-out infinite alternate; }
  @keyframes glow-drift-1 { to { transform: translate3d(-4%, 3%, 0) scale(1.05); } }
  @keyframes glow-drift-2 { to { transform: translate3d(4%, -3%, 0) scale(1.06); } }
}

/* Sprocket spin after clicking "Start a ministry" (timing lives here and in main.js) */
.sprocket {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  animation: sprocket-in .18s linear both;
}
/* The page fades away behind the sprocket while the background glow stays */
body.is-leaving > :not(.sprocket) { opacity: 0; transition: opacity .18s linear; }
.sprocket__mark {
  position: relative; width: min(88vw, 680px); aspect-ratio: 1397 / 803;
  animation: sprocket-out .3s linear 1.75s both;
}
.sprocket__gear, .sprocket__cross, .sprocket__letters { position: absolute; inset: 0; width: 100%; height: 100%; }
/* The three layers line up into the full logo. These origins are the centers of the sprocket and cross. */
.sprocket__gear { transform-origin: 38.7% 50%; animation: sprocket-spin 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.sprocket__cross { transform-origin: 36.5% 44%; animation: sprocket-cross .35s cubic-bezier(0.2, 0.8, 0.2, 1) .75s both; }
.sprocket__letters { animation: sprocket-cross .35s cubic-bezier(0.2, 0.8, 0.2, 1) .75s both; }
@keyframes sprocket-in { from { opacity: 0; } }
@keyframes sprocket-out { to { opacity: 0; } }
@keyframes sprocket-spin {
  from { opacity: 0; transform: scale(.6) rotate(-360deg); }
  to { opacity: 1; transform: none; }
}
@keyframes sprocket-cross {
  from { opacity: 0; transform: scale(.8); }
  to { opacity: 1; transform: none; }
}

/* Motion: everything is visible without JS and with reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .8s var(--ease) both; }
  .rise--2 { animation-delay: .08s; }
  .rise--3 { animation-delay: .16s; }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } }

  /* Main button: a soft shine and arrow nudge, once every 5 seconds */
  .btn--main::after {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 45%;
    background: linear-gradient(100deg, transparent, rgb(255 255 255 / .28), transparent);
    transform: translateX(-120%);
    pointer-events: none;
    animation: shine 5s cubic-bezier(0.2, 0.8, 0.2, 1) 1.2s infinite;
  }
  @keyframes shine { 0% { transform: translateX(-120%); } 22%, 100% { transform: translateX(340%); } }
  .btn--main svg { animation: nudge 5s ease-in-out 1.2s infinite; }
  @keyframes nudge {
    0%, 8%, 24%, 100% { transform: translateX(0); }
    16% { transform: translateX(5px); }
  }

  .js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }

  @supports (animation-timeline: view()) {
    .how__gear { animation: spin linear both; animation-timeline: view(); }
    @keyframes spin { from { transform: rotate(-70deg); } to { transform: rotate(70deg); } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Tablet */
@media (max-width: 900px) {
  .hero { min-height: 0; grid-template-columns: minmax(0, 1fr); }
  .hero__copy { padding: 24px 1.25rem 28px; }
  .hero__photo { min-height: 0; aspect-ratio: 4 / 3; }
  .nav__toggle { display: grid; }
  .nav__menu {
    position: absolute; left: 0; right: 0; top: var(--nav-h);
    display: none; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px 20px 20px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .nav__menu.is-open { display: flex; }
  .nav__links { flex-direction: column; align-items: stretch; gap: 4px; }
  .nav__links a { display: flex; align-items: center; min-height: 48px; }
  .nav__menu .btn { margin-top: 8px; min-height: 50px; }

  .mission, .donate { grid-template-columns: minmax(0, 1fr); }
  .donate__text { order: -1; }
  .how__gear { width: 110vw; right: -45%; margin-top: -58vw; }
  .footer__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer__logo { grid-column: 1 / -1; }
}

/* Phone */
@media (max-width: 640px) {
  .hero__copy { padding-block: 16px 20px; }
  .hero__sub { margin-top: 10px; }
  .hero__cta { margin-top: 16px; }
  .hero__cta .btn { width: 100%; }
  .hero__photo { aspect-ratio: 1; }
  .hero__photo img { object-position: 90% 100%; }

  .how__list li { grid-template-columns: minmax(0, 1fr); }
  .how__apply .btn, .donate .btn { width: 100%; }

  .merch__head .btn { width: 100%; }
  .merch__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .item--lead { grid-column: 1 / -1; grid-row: auto; }
  .item__img { flex: none; }
  .item__meta { flex-direction: column; }

  .footer__inner { grid-template-columns: minmax(0, 1fr); }
}

.footer__scripture { margin-top: 8px; font-size: .85rem; }

