/* ============================================================
   THE CHURCH — layers on top of styles.css
   Sacred (gold, geometry, halos) x Internet (pixel, CRT, glitch)
   x Modern (cards, dashboards, smooth motion)
   ============================================================ */

/* ---------- GLOBAL ---------- */
/* the header is sticky, so anchored sections must stop clear of it */
[id] { scroll-margin-top: 96px; }

/* `overflow-x: hidden` on body makes body its own scroll container, which on a
   page this tall strands the last ~2000px out of the window's scroll range.
   `clip` clamps the horizontal axis without creating a scroll container. */
body {
  overflow-x: hidden; /* fallback for browsers without `clip` */
  overflow-x: clip;
}

/* the shell was capped for 1440px screens; give ultrawide displays room */
@media (min-width: 1700px) {
  .section-shell { width: min(1420px, calc(100vw - 32px)); }
}

/* ---------- NAVIGATION ---------- */
.site-header { gap: 12px; }
.mainnav { display: flex; }
.nav-root {
  display: flex;
  align-items: center;
  gap: clamp(2px, 1vw, 14px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-group { position: relative; }
.nav-trigger {
  appearance: none;
  background: transparent;
  border: 2px solid transparent;
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 10px 10px;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.nav-trigger:hover,
.nav-group.open .nav-trigger {
  color: var(--leaf-hot);
  border-color: var(--line);
  background: rgba(147, 255, 139, .06);
}
.nav-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translate(-50%, -8px);
  min-width: 232px;
  display: grid;
  padding: 10px;
  background: rgba(6, 14, 8, .97);
  border: 2px solid var(--line);
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 30;
}
.nav-panel::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(6, 14, 8, .97);
  border-left: 2px solid var(--line);
  border-top: 2px solid var(--line);
}
.nav-group.open .nav-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.nav-panel a {
  padding: 11px 12px;
  font-family: var(--fantasy);
  font-size: 17px;
  color: #dce9cb;
  border-left: 3px solid transparent;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.nav-panel a:hover {
  background: rgba(147, 255, 139, .09);
  border-left-color: var(--gold);
  color: var(--leaf-hot);
}

.header-tools { display: flex; align-items: center; gap: 10px; }
.header-cta { font-family: var(--pixel); white-space: nowrap; }

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 42px;
  padding: 0 10px;
  background: rgba(147, 255, 139, .07);
  border: 2px solid var(--line);
  cursor: pointer;
}
.nav-burger span {
  display: block;
  height: 3px;
  background: var(--leaf-hot);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.drawer {
  position: fixed;
  inset: 74px 0 0;
  z-index: 19;
  overflow-y: auto;
  background: rgba(4, 10, 6, .98);
  backdrop-filter: blur(10px);
  border-top: 2px solid var(--line);
}
.drawer[hidden] { display: none; }
.drawer-inner {
  display: grid;
  gap: 22px;
  padding: 26px clamp(18px, 5vw, 40px) 60px;
}
.drawer-inner section { display: grid; gap: 2px; }
.drawer-inner h4 {
  margin: 0 0 8px;
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
}
.drawer-inner a {
  padding: 10px 0;
  font-family: var(--fantasy);
  font-size: 20px;
  color: #dce9cb;
  border-bottom: 1px solid rgba(147, 255, 139, .12);
}
.drawer-cta { justify-self: start; margin-top: 10px; }

/* ---------- JOURNEY RAIL (the emotional progression, made literal) ---------- */
.journey-rail {
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
  pointer-events: none;
}
.journey-rail li {
  position: relative;
  padding-left: 22px;
  max-width: 190px;
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.7;
  color: rgba(180, 199, 159, .34);
  transition: color .3s ease, opacity .3s ease;
}
.journey-rail li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 9px;
  height: 9px;
  border: 2px solid rgba(180, 199, 159, .34);
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.journey-rail li.reached { color: var(--leaf-hot); }
.journey-rail li.reached::before {
  background: var(--leaf);
  border-color: var(--leaf-hot);
  box-shadow: 0 0 12px rgba(147, 255, 139, .6);
}
.journey-rail li.current { color: var(--gold); }
.journey-rail li.current::before { background: var(--gold); border-color: var(--gold); }

/* ---------- HERO HALO ---------- */
.halo {
  position: absolute;
  width: min(300px, 62vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 6px solid rgba(243, 198, 93, .5);
  box-shadow: 0 0 60px rgba(243, 198, 93, .35), inset 0 0 40px rgba(243, 198, 93, .18);
  transform: translateY(-34%) rotateX(74deg);
  z-index: 2;
}

/* ---------- GRIDS ---------- */
.grid-3, .grid-4 {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.grid-3 article, .grid-4 article {
  padding: 24px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(0, 0, 0, .38);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.grid-3 article:hover, .grid-4 article:hover {
  transform: translateY(-4px);
  border-color: rgba(243, 198, 93, .55);
}
.grid-4 .pixel-icon, .grid-3 .pixel-icon { margin-bottom: 22px; }
.culture-lead { background: linear-gradient(135deg, rgba(18, 61, 29, .9), rgba(33, 21, 11, .8)); }

/* ---------- FLYWHEEL ---------- */
.flywheel-section {
  padding: 86px 0;
  background:
    radial-gradient(circle at 50% 46%, rgba(82, 211, 109, .12), transparent 60%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, .35), transparent);
}
.flywheel-wrap {
  margin-top: 30px;
  display: grid;
  place-items: center;
}
.flywheel {
  width: min(760px, 100%);
  height: auto;
  overflow: visible;
}
.flywheel text {
  font-family: var(--pixel);
  font-size: 10px;
  fill: var(--leaf-hot);
  text-anchor: middle;
  letter-spacing: .02em;
}
.flywheel .fw-gold { fill: var(--gold); }
.flywheel .fw-centre {
  font-size: 13px;
  fill: var(--bone);
  font-family: var(--pixel);
}
.flywheel .fw-nodes g { transition: transform .2s ease; transform-box: fill-box; transform-origin: center; }
.flywheel .fw-nodes g:hover { transform: scale(1.06); }
.fw-ring { animation: fwSpin 60s linear infinite; transform-origin: 400px 400px; }
.fw-arrows polygon { filter: drop-shadow(0 0 6px rgba(243, 198, 93, .5)); }
@keyframes fwSpin { to { transform: rotate(360deg); } }

.flywheel-chain {
  display: none;
  counter-reset: chain;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  gap: 8px;
}
.flywheel-chain li {
  position: relative;
  padding: 14px 16px 14px 54px;
  background: rgba(10, 26, 13, .8);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 #000;
  font-family: var(--fantasy);
  font-size: 20px;
  color: #e8ffd7;
}
.flywheel-chain li::before {
  counter-increment: chain;
  content: counter(chain, decimal-leading-zero);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--gold);
}
.flywheel-chain li:not(:last-child)::after {
  content: "↓";
  display: block;
  position: absolute;
  left: 50%;
  bottom: -20px;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 16px;
  z-index: 2;
}
.flywheel-chain .chain-centre {
  background: linear-gradient(135deg, rgba(56, 34, 16, .9), rgba(8, 24, 11, .92));
  border-color: rgba(243, 198, 93, .5);
  color: var(--gold);
  text-align: center;
  padding-left: 16px;
}
.flywheel-chain .chain-centre::before { content: ""; }

.philosophy-quote {
  margin: 48px auto 0;
  max-width: 900px;
  padding: 28px clamp(20px, 4vw, 44px);
  border-left: 4px solid var(--gold);
  background: rgba(0, 0, 0, .3);
  font-family: var(--fantasy);
  font-size: clamp(20px, 2.7vw, 32px);
  line-height: 1.4;
  color: #f4e9bf;
  text-align: center;
}

/* ---------- SCRIPTURE EXTRAS ---------- */
.commandments-section { padding: 86px 0; }
.scripture-extras { margin-top: 22px; }
.daily-card { background: linear-gradient(135deg, rgba(56, 34, 16, .82), rgba(8, 24, 11, .9)) !important; }
.verse {
  font-family: var(--fantasy);
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.25;
  color: #f4e9bf !important;
}
.verse-meta { font-family: var(--pixel); font-size: 9px; color: var(--gold) !important; }
.campaign-links { margin-top: 18px; }

/* ---------- FINAL GOSPEL SECTION ---------- */
.gospel {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 30px;
  padding: 90px clamp(18px, 5vw, 60px);
  text-align: center;
  background: #000;
  border-block: 2px solid var(--line);
  overflow: hidden;
}
.gospel::before {
  content: "";
  position: absolute;
  width: min(760px, 120vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 198, 93, .22), rgba(82, 211, 109, .08) 45%, transparent 70%);
  animation: gospelPulse 6s ease-in-out infinite;
}
.gospel-fish {
  position: relative;
  z-index: 2;
  width: min(360px, 74vw);
  filter: drop-shadow(0 0 60px rgba(243, 198, 93, .55)) drop-shadow(0 22px 0 rgba(0, 0, 0, .6));
  animation: float 5s ease-in-out infinite;
}
.gospel-copy { position: relative; z-index: 2; display: grid; gap: 22px; justify-items: center; }
.gospel-lead {
  max-width: 1000px;
  margin: 0;
  font-size: clamp(30px, 5.4vw, 74px);
  line-height: 1.02;
  letter-spacing: -.05em;
  text-transform: uppercase;
  text-shadow: 6px 6px 0 #0b0b0b, 0 0 50px rgba(147, 255, 139, .25);
}
.gospel-lead em {
  font-family: var(--fantasy);
  font-style: normal;
  text-transform: none;
  color: var(--gold);
  letter-spacing: -.02em;
}
.litany {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-family: var(--fantasy);
  font-size: clamp(20px, 2.6vw, 30px);
  color: #dce9cb;
}
.above-all { margin: 0; font-family: var(--pixel); font-size: 10px; color: var(--muted); }
.follow {
  margin: 0;
  font-family: var(--pixel);
  font-size: clamp(14px, 2.6vw, 26px);
  color: var(--gold);
  text-transform: uppercase;
  text-shadow: 4px 4px 0 #000, 0 0 30px rgba(243, 198, 93, .5);
}
.gospel .final-actions { justify-content: center; margin-top: 8px; }

@keyframes gospelPulse {
  0%, 100% { transform: scale(1); opacity: .85; }
  50% { transform: scale(1.07); opacity: 1; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1180px) {
  .journey-rail { display: none; }
  .nav-trigger { font-size: 8px; padding: 9px 7px; }
}
@media (max-width: 1024px) {
  .mainnav { display: none; }
  .nav-burger { display: flex; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; }
}
@media (max-width: 760px) {
  .flywheel { display: none; }
  .flywheel-chain { display: grid; }
  .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: span 1; }
  .header-cta { display: none; }
  .gospel { min-height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .fw-ring, .gospel::before, .gospel-fish { animation: none; }
  .flywheel .fw-nodes g:hover { transform: none; }
}
