/* ============================================================
   Mirath: Home view (#/home)
   The threshold of the chamber. A two-column hero: the welcome
   and the two paths on the left, the calligraphic phrase
   نِصْفُ الْعِلْمِ (half of knowledge) on the right; below 900px
   the aside takes order: -1, so the calligraphy leads the page
   before the title (DOM order alone would leave it under the
   CTAs). Then the hadith it is drawn from, and the ledger status
   panel when a plan has begun. All colors via css/tokens.css
   (dark adapts).
   ============================================================ */

.homeview {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vh, 4.5rem);
  padding-block: clamp(1.5rem, 5vh, 4rem) clamp(2rem, 6vh, 4rem);
}

/* ---------- Hero band ---------- */

.homeview-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

.homeview-hero-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 34rem;
}

.homeview-eyebrow {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.homeview-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.5rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}

.homeview-lede {
  margin: 0;
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* ---------- The two paths ---------- */

.homeview-paths {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-1);
}

.homeview-paths .btn {
  flex: 0 0 auto;
}

/* ---------- Trust line ---------- */

.homeview-trust {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  font-size: var(--text-footnote);
  color: var(--color-text-faint);
}

.homeview-trust-mark {
  display: inline-flex;
  color: var(--color-accent);
}

.homeview-trust-mark .icon {
  width: 16px;
  height: 16px;
}

/* The estate-model honesty line: same quiet register as the trust
   line above it; the link keeps the faint ink and is carried by its
   underline alone. */
.homeview-trust--reach {
  margin-top: var(--space-1);
}

.homeview-trust--reach a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.homeview-trust--reach a:hover {
  color: var(--color-text-primary);
}

/* ---------- Calligraphic aside ---------- */

.homeview-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  text-align: center;
  padding: clamp(1.5rem, 4vw, 2.5rem) var(--space-4);
}

.homeview-calligraphy {
  margin: 0;
  font-family: var(--font-arabic);
  font-weight: 700;
  font-size: clamp(3.25rem, 9vw, 5.5rem);
  line-height: 1.5;
  color: var(--color-accent);
  /* no letter-spacing on Arabic, ever */
  letter-spacing: 0;
}

.homeview-calligraphy-gloss {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-callout);
  color: var(--color-text-faint);
}

/* ---------- The hadith ---------- */

.homeview-hadith {
  margin: 0;
  max-width: 40rem;
  padding-inline-start: var(--space-5);
  border-inline-start: 3px solid var(--color-accent);
}

.homeview-hadith-intro {
  margin: 0 0 var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-subhead);
  color: var(--color-text-secondary);
}

.homeview-hadith-quote {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-h3);
  line-height: 1.55;
  color: var(--color-text-primary);
}

.homeview-hadith-source {
  margin: var(--space-4) 0 0;
  font-family: var(--font-sans);
  font-size: var(--text-footnote);
  color: var(--color-text-faint);
}

/* ---------- Ledger status panel (when a plan has begun) ---------- */

.homeview-status {
  max-width: 46rem;
}

.homeview-status-heading {
  margin: 0 0 var(--space-5);
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  color: var(--color-text-primary);
}

.homeview-status-note {
  margin: var(--space-5) 0 0;
  font-size: var(--text-callout);
  line-height: 1.55;
  color: var(--color-text-secondary);
}

.homeview-status-touched {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-footnote);
  color: var(--color-text-faint);
}

/* One quiet line of proportion when the substance is recorded but the
   papers are not yet drawn (ux-trust-playbook §Pattern 2). */
.homeview-status-reassure {
  display: block;
  margin-top: var(--space-2);
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-text-secondary);
}

.homeview-status-actions {
  margin-top: var(--space-6);
}

/* ---------- <900px: the calligraphy leads ----------
   In source the aside follows the hero body (it is the right-hand
   column on wide screens), but on the narrow screen it settles ABOVE
   the title: the threshold phrase greets the reader before the
   welcome. order: -1 reorders the grid item; ≥900px the two-column
   grid below restores source order. */

@media (max-width: 899.98px) {
  .homeview-aside {
    order: -1;
    padding-block: 0 var(--space-2);
  }
}

/* ---------- ≥900px: the wide chamber with two columns ---------- */

@media (min-width: 900px) {
  .homeview-hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: clamp(3rem, 5vw, 5rem);
    min-height: min(58vh, 30rem);
  }

  /* The calligraphy stands apart on a brass rule. */
  .homeview-aside {
    border-inline-start: 1px solid var(--color-separator);
    align-self: stretch;
  }
}
