/* ==========================================================================
   Mfariji — public home page
   Hero, the Mfariji AI companion, the tongues room and the psalm grid.
   ========================================================================== */

/* ---------------------------------------------------------------- hero -- */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: 56px clamp(22px, 4vw, 44px) 150px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: radial-gradient(120% 150% at 12% 0%, #5f1244 0%, #2a0b23 55%, #1b0717 100%);
  isolation: isolate;
}

.hero__title {
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.05;
  max-width: 16ch;
  background: linear-gradient(120deg, #fff 25%, var(--brand-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__title em { font-style: normal; color: inherit; }

.hero__lede {
  max-width: 52ch;
  font-size: 16px;
  line-height: 1.6;
  color: #e9c9dd;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

/* Above the congregation silhouette, never through it. */
.hero__stats {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-faint);
}
.hero__stats b {
  display: block;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 22px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* The congregation silhouette anchoring the hero */
.hero__crowd {
  position: absolute;
  inset-inline: 0;
  inset-block-end: -2px;
  z-index: -1;
  width: 100%;
  height: 120px;
  opacity: 0.5;
  pointer-events: none;
}

/* ------------------------------------------------------------ mfariji ai */

.ai {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(150deg, rgba(179, 26, 99, 0.16), rgba(18, 165, 148, 0.1) 90%);
}

.ai__head { display: flex; align-items: center; gap: 16px; }

.ai__orb {
  flex: none;
  width: 52px; height: 52px;
  border-radius: var(--r-full);
  background: radial-gradient(circle at 35% 30%, #fff, var(--brand) 45%, var(--brand-strong) 80%);
  box-shadow: 0 0 0 6px rgba(224, 37, 127, 0.14), 0 0 34px rgba(224, 37, 127, 0.55);
  animation: pulse 3.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.ai__head h2 { font-size: 20px; }
.ai__head p { font-size: 13.5px; color: var(--text-muted); }

.moods { display: flex; flex-wrap: wrap; gap: 8px; }

.mood {
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.mood:hover {
  background: rgba(224, 37, 127, 0.18);
  border-color: rgba(224, 37, 127, 0.45);
  color: #fff;
}

.ai__input { display: flex; flex-wrap: wrap; gap: 10px; }
.ai__input input {
  flex: 1;
  min-width: 220px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 15px;
}
.ai__input input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(224, 37, 127, 0.14);
}

.ai__result { display: none; flex-direction: column; gap: 14px; }
.ai__result.is-visible { display: flex; }

.ai__word {
  padding: 18px 22px;
  border-left: 3px solid var(--brand);
  border-radius: 0 14px 14px 0;
  background: rgba(0, 0, 0, 0.28);
  color: #fbe0ee;
  font-size: 16px;
  font-style: italic;
  line-height: 1.6;
}
.ai__word b {
  display: block;
  margin-bottom: 6px;
  font-style: normal;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-soft);
}

/* ------------------------------------------------------------- tongues -- */

.tongues {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 38px clamp(22px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: radial-gradient(120% 130% at 18% -10%, #7a1440, #2a0b23 58%, #180612);
}

/* The room's own light: a slow orange breath behind the copy. */
.tongues__halo {
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 120%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(240, 130, 30, 0.28), transparent 70%);
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.75; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.06); }
}

.tongues__flames {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.9;
}

/* Barely blurred and fully opaque down the length, or these read as smudges
   rather than candles. */
.flame {
  position: absolute;
  bottom: -10px;
  width: 26px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: linear-gradient(180deg, #ffd27a, #f0821e 55%, #b31a63);
  filter: blur(0.4px);
  opacity: 0.55;
  transform-origin: bottom center;
  animation: flick 1.6s ease-in-out infinite;
}
@keyframes flick {
  0%, 100% { transform: scaleY(1) scaleX(1) rotate(-2deg); }
  50% { transform: scaleY(1.22) scaleX(0.9) rotate(2deg); }
}

.tongues > *:not(.tongues__flames):not(.tongues__halo) { position: relative; z-index: 2; }

.tongues .eyebrow {
  letter-spacing: 0.24em;
  color: #ffcaa0;
  border-color: rgba(255, 202, 160, 0.3);
}

.tongues h2 {
  font-size: clamp(26px, 4vw, 40px);
  background: linear-gradient(110deg, #fff, #ffd0ad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tongues p { max-width: 640px; color: #efc9d8; font-size: 15px; line-height: 1.65; }

/* ---------------------------------------------------------- psalm grid -- */

.psalms__toggle { align-self: flex-start; }

.psalm-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.psalm-grid.is-open { display: grid; }

.psalm-grid button {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.psalm-grid button:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
  transform: translateY(-2px);
}

.psalm-grid__empty {
  grid-column: 1 / -1;
  color: var(--text-faint);
  font-size: 13.5px;
  text-align: center;
}

/* -------------------------------------------------------------- splash -- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  gap: 12px;
  background: radial-gradient(700px 500px at 50% 40%, var(--surface-2), var(--bg) 72%);
  animation: splash-out 0.5s var(--ease) 2.4s forwards;
}
.splash__inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.splash__mark { width: min(260px, 62vw); }
.splash__mark :is(svg, img) { width: 100%; height: auto; max-height: 150px; object-fit: contain; }
.splash__slogan { color: var(--brand-soft); font-style: italic; letter-spacing: 0.02em; }

@keyframes splash-out { to { opacity: 0; visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .splash { animation: none; opacity: 0; visibility: hidden; }
}

/* --------------------------------------------------------- empty state -- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  text-align: center;
  color: var(--text-faint);
}
.empty-state h3 { color: var(--text); font-size: 17px; }

/* --------------------------------------------------------- search state -- */

.search-count {
  font-size: 13.5px;
  color: var(--text-muted);
}
.search-count::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-inline-end: 9px;
  border-radius: var(--r-full);
  background: var(--brand);
  vertical-align: middle;
}

/* With the hero and companion out of the way, results start at the top. */
body.is-searching .page { gap: 20px; }
