/* Home page: the landing section and the projects / developers / about / contact sections of the hash-routed
   single page. Builds on site.css (nav, footer, page header, cards, chips, stats, empty states). */

/* ---------- Sections ----------
   home.js sets <html data-spa-section="..."> from the URL hash; without JS the home section shows. */
.spa-section { display: none; }
html:not([data-spa-section]) #spa-home,
html[data-spa-section="home"] #spa-home,
html[data-spa-section="projects"] #spa-projects,
html[data-spa-section="developers"] #spa-developers,
html[data-spa-section="about"] #spa-about,
html[data-spa-section="contact"] #spa-contact { display: block; }
/* home.js focuses the heading of a section after switching to it. */
.spa-section h1[tabindex="-1"]:focus { outline: none; }

.home-grid-span { grid-column: 1 / -1; }

/* ---------- Hero ---------- */
.home-hero {
  background:
    radial-gradient(55% 60% at 88% 30%, var(--green-50) 0%, transparent 70%),
    linear-gradient(180deg, var(--blue-50) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 4.5rem 0 4rem;
}
.home-title { font-size: clamp(2.15rem, 4.4vw, 3.5rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.035em; margin-bottom: 1.1rem; }
.home-title-backers { color: var(--blue); }
.home-title-builders { color: var(--green-700); }
.home-lead { color: var(--muted); font-size: 1.15rem; line-height: 1.6; max-width: 36rem; margin-bottom: 1.5rem; }

.home-audiences { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 0.7rem; }
.home-audiences li { display: flex; align-items: center; gap: 0.75rem; color: var(--text); }
.home-audiences strong { color: var(--ink); }
.home-audience-icon { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 0.88rem; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); color: var(--blue); }
.home-audiences li:nth-child(2) .home-audience-icon { color: var(--amber-700); }
.home-audiences li:nth-child(3) .home-audience-icon { color: var(--green-700); }

.home-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.home-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; }
.home-google { gap: 0.7rem; padding-left: 0.6rem; }
.home-google-mark { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface); flex: 0 0 30px; }

.home-stats { display: flex; flex-wrap: wrap; gap: 1.5rem 2.75rem; margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.home-sk-stat { display: inline-block; width: 3rem; height: 1.6rem; vertical-align: middle; }

.home-hero-art { display: block; width: 100%; height: auto; max-width: 660px; margin-inline: auto; }

/* ---------- How it works ---------- */
.home-steps { background: var(--surface); border-bottom: 1px solid var(--border); }
.home-section-head { max-width: 44rem; margin-bottom: 3rem; }
.home-step-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.home-step { text-align: center; padding: 1.75rem 1.5rem 2rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.home-step-art { height: 170px; display: flex; align-items: center; justify-content: center; margin-bottom: 1.25rem; }
.home-step-art img { height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.home-step-num { width: 32px; height: 32px; margin: 0 auto 0.85rem; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: var(--surface); font-weight: 700; font-size: 0.9rem; }
.home-step-title { font-size: 1.15rem; margin-bottom: 0.5rem; }
.home-step-text { color: var(--muted); margin: 0 auto; max-width: 34ch; line-height: 1.6; }

/* ---------- Listings ---------- */
.home-listing { padding: 4rem 0 3.5rem; }
.home-featured { padding-top: 0.5rem; }
.home-devs { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding-bottom: 4rem; }
.home-listing-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 2rem; margin-bottom: 2rem; }
/* Three across on desktop, so six latest projects fill two rows. */
@media (min-width: 992px) {
  .home-listing .p-grid, .home-listing .d-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.home-see-all { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 40px; font-weight: 600; text-decoration: none; color: var(--blue); }
.home-see-all i { font-size: 0.8em; transition: transform 0.18s ease; }
.home-see-all:hover { color: var(--blue-700); }
.home-see-all:hover i { transform: translateX(3px); }

/* Placeholder cards while loading. */
.home-skeleton-card, .home-skeleton-card:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }
.home-skeleton-card .p-card-media { border-radius: 0; }
.home-skeleton-card .p-card-body { padding-bottom: 1.4rem; }
.home-sk-line { height: 0.8rem; margin-bottom: 0.55rem; }
.home-sk-avatar { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; }

/* ---------- Closing call to action ---------- */
.home-cta-wrap { padding-top: 4rem; }
.home-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2.5rem; padding: 2.5rem 3rem; border-radius: var(--radius-lg); border: 1px solid var(--border); background: linear-gradient(120deg, var(--blue-50) 0%, var(--green-50) 100%); }
.home-cta-text { max-width: 38rem; }
.home-cta-text p { color: var(--muted); }
.home-cta-title { font-size: clamp(1.4rem, 2.4vw, 1.8rem); margin-bottom: 0.45rem; }
.home-cta-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Directory sections ---------- */
.home-directory { padding-top: 2rem; }
.home-filter { padding: 1rem; margin-bottom: 1.25rem; }
.home-filter-row { display: flex; gap: 0.75rem; }
.home-search { position: relative; flex: 1; min-width: 0; }
.home-search > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; font-size: 0.9rem; }
.home-search .form-control { padding-left: 2.6rem; min-height: 46px; }
.home-filter-submit { min-height: 46px; padding-inline: 1.6rem; }
.home-filter-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.home-filter-chips .chip { min-height: 40px; padding: 0 1rem; font-size: 0.85rem; }
.home-filter-chips .chip i { color: var(--amber-700); font-size: 0.8em; }
.home-filter-chips .chip.is-active, .home-filter-chips .chip.is-active:hover { color: var(--surface); }
.home-filter-chips .chip.is-active i { color: inherit; }
.home-results-meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem; min-height: 1.4rem; }
.home-directory .pagination .page-link { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- About ---------- */
.home-about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1.5rem; margin-top: 2rem; }
.home-about-card { padding: 1.75rem; display: flex; flex-direction: column; }
.home-about-card h3 { margin-bottom: 0.5rem; }
.home-about-card p { color: var(--muted); line-height: 1.6; flex: 1; }
.home-about-icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: var(--radius); display: grid; place-items: center; font-size: 1.05rem; background: var(--blue-50); color: var(--blue); margin-bottom: 1.1rem; }
.home-about-card:nth-child(2) .home-about-icon { background: var(--amber-50); color: var(--amber-700); }
.home-about-card:nth-child(3) .home-about-icon { background: var(--green-50); color: var(--green-700); }
.home-about-link { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; color: var(--blue); }
.home-about-link a { text-decoration: none; }
.home-about-link i { font-size: 0.8em; }
.home-prose { max-width: 62ch; font-size: 1.05rem; line-height: 1.7; }
.home-about-art { width: min(100%, 420px); height: auto; }
@media (max-width: 991.98px) { .home-about-art { width: min(100%, 280px); } }

/* ---------- Contact ---------- */
.home-contact { padding-top: 2.5rem; }
.home-contact-card { padding: 2rem; }
.home-contact-aside { display: grid; gap: 1rem; }
.home-contact-item { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; color: var(--text); text-decoration: none; }
.home-contact-item strong { color: var(--ink); }
.home-contact-item .home-about-icon { margin-bottom: 0; }
a.home-contact-item { transition: box-shadow 0.18s ease, border-color 0.18s ease; }
a.home-contact-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow); color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .home-hero { padding: 3rem 0; }
  .home-hero-art { max-width: 560px; }
  .home-cta { padding: 2rem; }
}

@media (max-width: 767.98px) {
  .home-step-list { grid-template-columns: 1fr; max-width: 30rem; margin-inline: auto; }
  .home-step-art { height: 150px; }
  .home-listing { padding: 3rem 0 2.5rem; }
  .home-devs { padding-bottom: 3rem; }
}

@media (max-width: 575.98px) {
  .home-hero { padding: 2.25rem 0 2.5rem; }
  .home-lead { font-size: 1.05rem; }
  .home-actions .btn, .home-cta-actions .btn { flex: 1 1 100%; justify-content: center; }
  .home-stats { gap: 1.25rem 2rem; }
  /* Steps side by side with a small illustration, to keep the page short. */
  .home-step { display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 1rem; align-items: start; text-align: left; padding: 1.25rem; }
  .home-step-art { grid-row: span 3; height: auto; margin: 0; }
  .home-step-art img { width: 100%; height: auto; }
  .home-step-num { margin: 0 0 0.5rem; width: 28px; height: 28px; font-size: 0.82rem; }
  .home-step-title { font-size: 1.05rem; }
  .home-step-text { margin: 0; font-size: 0.95rem; }
  .home-cta { padding: 1.75rem 1.25rem; }
  .home-filter { padding: 0.75rem; }
  .home-filter-submit { padding-inline: 1rem; }
  .home-contact-card { padding: 1.25rem; }
}

/* Phones: three latest projects are enough before "Browse all projects". */
@media (max-width: 767.98px) {
  #homeLatest > .p-card:nth-child(n + 4) { display: none; }
}
