/* The public home page (templates/home.html). Same tokens as app.css, so light and dark themes follow along. */

.home .h-center { margin-left: auto; margin-right: auto; text-align: center; }

/* Hero */
.h-hero { position: relative; overflow: hidden; padding: 64px 0 40px; }
.h-hero::before {
  content: ""; position: absolute; inset: -30% -10% auto auto; width: 720px; height: 720px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 16%, transparent), transparent);
  pointer-events: none;
}
/* Background: a row of apartment blocks, some windows lit green like tenants who've paid (img/home/hero-blocks.svg). */
.h-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; pointer-events: none; z-index: 0; opacity: .55;
  background: url("../img/home/hero-blocks.c7c4e84a3fa7.svg") center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(to top, #000 20%, transparent 95%); mask-image: linear-gradient(to top, #000 20%, transparent 95%);
}
:root[data-theme="dark"] .h-hero::after { filter: brightness(1.4); opacity: .4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .h-hero::after { filter: brightness(1.4); opacity: .4; } }
.h-hero > .wrap { position: relative; z-index: 1; }
.h-hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.h-hero h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 780; letter-spacing: -0.035em; line-height: 1.06; }
.h-hero h1 em { font-style: normal; color: var(--brand); }
.h-lead { font-size: 18px; line-height: 1.6; color: var(--text-2); margin-top: 20px; max-width: 540px; }
.h-ctas { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.h-hero .price-line { margin-top: 16px; }
.h-setup { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; max-width: 520px;
           background: var(--brand-soft); color: var(--text); border-radius: var(--radius-sm); }
.h-setup svg { flex: none; color: var(--brand); margin-top: 2px; }

/* Hero visual: the April dashboard, an M-Pesa prompt and a receipt */
.h-visual { position: relative; padding: 24px 0 150px 24px; }  /* room for the floating cards below the rows, so they never cover a name or an amount */
.h-board { padding: 22px; border-radius: 20px; box-shadow: var(--shadow-lg); }
.h-board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.h-board-title { font-weight: 700; font-size: 17px; }
.h-meter { margin: 18px 0 8px; }
.h-meter-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--text-2); }
.h-meter-row b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.h-meter-row b .muted { font-weight: 500; font-size: 12px; }
.h-bar { height: 10px; border-radius: 99px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.h-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #34c48a); }
.h-rows { margin-top: 10px; }
.h-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--border); font-size: 14px; }
.h-row .avatar { width: 32px; height: 32px; font-size: 11px; flex: none; }
.h-who { flex: 1; min-width: 0; font-weight: 600; line-height: 1.25; }
.h-who small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.h-row b { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.h-float { position: absolute; border-radius: 16px; box-shadow: var(--shadow-lg); font-size: 13px; line-height: 1.4; }
.h-stk { right: -8px; bottom: 0; width: 210px; padding: 14px; background: #f3f4f6; color: #101828; border: 6px solid #101828; }
.h-stk-top { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #0e7a4b; margin-bottom: 6px; }
.h-stk b { display: block; font-size: 15px; }
.h-stk span { color: #475467; }
.h-pin { margin-top: 8px; padding: 6px 10px; background: #fff; border-radius: 8px; letter-spacing: .3em; font-weight: 700; }
.h-receipt { left: -12px; bottom: 56px; width: 230px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); }
.h-receipt-from { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; color: var(--brand); margin-bottom: 4px; }

/* A rent month */
.h-timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: month; position: relative; }
.h-timeline::before { content: ""; position: absolute; top: 19px; left: 6%; right: 6%; height: 2px;
                      background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 25%, transparent)); }
.h-timeline li { position: relative; padding-top: 56px; }
.h-timeline li::before {
  counter-increment: month; content: counter(month); position: absolute; top: 0; left: 0; width: 40px; height: 40px;
  border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-weight: 800;
  box-shadow: 0 0 0 6px var(--surface);
}
.h-when { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.h-timeline h3 { font-size: 18px; margin-top: 4px; }
.h-timeline p { color: var(--text-2); font-size: 14px; margin-top: 6px; line-height: 1.55; }

/* Features */
.h-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.h-feature { padding: 26px; transition: transform .15s, box-shadow .15s; }
.h-feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.h-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
          background: var(--brand-soft); color: var(--brand); margin-bottom: 16px; }
.h-icon svg { width: 22px; height: 22px; }
.h-feature h3 { font-size: 17px; }
.h-feature p { color: var(--text-2); font-size: 14px; margin-top: 8px; line-height: 1.55; }

/* Who it's for */
.h-who-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.h-who-card { padding: 26px; display: flex; flex-direction: column; }
.h-who-card h3 { font-size: 18px; }
.h-who-card .checks { margin-top: 14px; font-size: 14px; }
.h-more { margin-top: auto; padding-top: 18px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }

/* Free tools */
.h-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.h-tool { display: flex; gap: 14px; align-items: flex-start; padding: 18px; color: var(--text); text-decoration: none;
          transition: border-color .15s, transform .15s; }
.h-tool:hover { border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.h-tool .h-icon { margin: 0; width: 40px; height: 40px; }
.h-tool strong { display: block; font-size: 15px; }
.h-tool small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.4; }

/* FAQ */
.h-faq-wrap { display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px; align-items: start; }
.h-faq { display: grid; gap: 10px; }
.h-faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 18px; }
.h-faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; }
.h-faq summary::-webkit-details-marker { display: none; }
.h-faq summary::after { content: "+"; color: var(--brand); font-weight: 700; font-size: 20px; line-height: 1; }
.h-faq details[open] summary::after { content: "−"; }
.h-faq details p { color: var(--text-2); padding: 0 0 16px; margin: 0; line-height: 1.6; }

.h-cta { background: linear-gradient(135deg, var(--brand), #0b6640); }

@media (prefers-reduced-motion: reduce) {
  .h-feature, .h-tool { transition: none; }
  .h-feature:hover, .h-tool:hover { transform: none; }
}

/* Tablets */
@media (max-width: 1000px) {
  .h-tools { grid-template-columns: repeat(2, 1fr); }
  .h-features, .h-who-grid { grid-template-columns: repeat(2, 1fr); }
  .h-timeline { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
  .h-timeline::before { display: none; }
}

/* Phones */
@media (max-width: 860px) {
  .h-hero { padding-top: 36px; }
  .h-hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .h-visual { padding: 0 0 160px; max-width: 460px; margin: 0 auto; width: 100%; }
  .h-receipt { left: 0; }
  .h-stk { right: 0; }
  .h-faq-wrap { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 600px) {
  .h-features, .h-who-grid, .h-tools, .h-timeline { grid-template-columns: 1fr; }
  /* No room to float: the receipt and the M-Pesa prompt sit side by side under the dashboard. */
  .h-visual { padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
  .h-board { grid-column: 1 / -1; }
  .h-float { position: static; width: auto; }
  .h-stk { border-width: 4px; }
}

/* --- Lively: motion and colour (everything still on "prefers-reduced-motion") ------------------------- */

/* The dashboard comes alive: the bar fills, the Live dot pulses, the cards float. */
.h-fill { width: 85%; animation: h-fill 1.6s .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes h-fill { from { width: 0; } }
.h-live { display: inline-flex; align-items: center; gap: 6px; }
.h-live::before { display: none !important; }
.h-live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: h-pulse 1.8s ease-out infinite; }
@keyframes h-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
.h-board { animation: h-rise .8s cubic-bezier(.2, .8, .2, 1) both; }
.h-stk { animation: h-rise .8s .5s cubic-bezier(.2, .8, .2, 1) both, h-float 6s 1.3s ease-in-out infinite; }
.h-receipt { animation: h-pop .6s 1.9s cubic-bezier(.3, 1.5, .5, 1) both, h-float 7s 2.6s ease-in-out infinite reverse; }
@keyframes h-rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes h-pop { from { opacity: 0; transform: scale(.85) translateY(10px); } }
@keyframes h-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.h-hero-copy > * { animation: h-rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.h-hero-copy > :nth-child(2) { animation-delay: .08s; } .h-hero-copy > :nth-child(3) { animation-delay: .16s; }
.h-hero-copy > :nth-child(4) { animation-delay: .24s; } .h-hero-copy > :nth-child(n+5) { animation-delay: .32s; }

/* Facts band: a fixed deep green in both themes, so the white text stays crisp. */
.h-facts { position: relative; overflow: hidden; color: #fff; padding: 40px 0;
           background: radial-gradient(120% 140% at 0% 0%, #13915a 0%, #0e7a4b 45%, #095a37 100%); }
.h-facts::after { content: ""; position: absolute; inset: 0; pointer-events: none;
                  background: radial-gradient(40% 120% at 100% 50%, rgb(52 196 138 / .18), transparent 70%); }
.h-facts-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.h-facts-grid > div { padding: 4px 18px; display: flex; flex-direction: column; align-items: center; }
.h-facts-grid > div + div { border-left: 1px solid rgb(255 255 255 / .16); }
.h-fact-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 12px;
               background: rgb(255 255 255 / .12); color: #b8f0d4; }
.h-facts b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.h-facts-grid > div > span:last-child { display: block; margin-top: 6px; font-size: 14px; color: rgb(255 255 255 / .82); max-width: 240px; }

/* Icon colours: green, amber, blue in turn */
.h-icon-amber { background: var(--warn-soft); color: var(--warn); }
.h-icon-blue { background: var(--info-soft); color: var(--info); }
.h-feature:hover .h-icon, .h-who-card:hover .h-icon { transform: rotate(-6deg) scale(1.06); }
.h-icon { transition: transform .2s; }

/* Fade up into view as you scroll (app.js adds .reveal-on to <html>, then .in to each item). */
.reveal-on [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
.reveal-on [data-reveal].in { opacity: 1; transform: none; }
.h-features [data-reveal]:nth-child(3n+2), .h-who-grid [data-reveal]:nth-child(2), .h-tools [data-reveal]:nth-child(2) { transition-delay: .08s; }
.h-features [data-reveal]:nth-child(3n), .h-who-grid [data-reveal]:nth-child(3), .h-tools [data-reveal]:nth-child(3) { transition-delay: .16s; }
.h-tools [data-reveal]:nth-child(4) { transition-delay: .24s; }

@media (max-width: 860px) {
  .h-facts-grid { grid-template-columns: repeat(2, 1fr); row-gap: 28px; }
  .h-facts-grid > div:nth-child(3) { border-left: 0; }
  .h-facts b { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .h-fill, .h-live i, .h-board, .h-stk, .h-receipt, .h-hero-copy > * { animation: none !important; }
  .reveal-on [data-reveal] { opacity: 1; transform: none; transition: none; }
  .h-icon { transition: none; }
}

/* Footer */
.h-footer { margin-top: 24px; background: var(--surface); border-top: 1px solid var(--border); color: var(--text-2); font-size: 14px; }
.h-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.1fr 1fr 1.3fr; gap: 32px; padding-top: 56px; padding-bottom: 40px; }
.h-footer-brand p { margin: 12px 0 0; max-width: 300px; line-height: 1.6; }
.h-footer-brand .logo { background-position: left center; }
.h-footer-col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.h-footer-col h3 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text); margin: 0 0 4px; }
.h-footer-col a:not(.btn) { color: var(--text-2); text-decoration: none; }
.h-footer-col a:not(.btn):hover { color: var(--brand); }
.h-footer-start p { margin: 0 0 4px; line-height: 1.5; }
.h-footer-login { font-size: 13px; }
.h-footer-base { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 28px;
                 border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.h-footer-legal { display: flex; gap: 18px; }
.h-footer-legal a { color: var(--muted); }
@media (max-width: 1000px) {
  .h-footer-grid { grid-template-columns: repeat(3, 1fr); }
  .h-footer-brand, .h-footer-start { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .h-footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; padding-top: 40px; }
  .h-footer-base { justify-content: center; text-align: center; }
}
.h-footer-brand .logo-lockup { align-items: flex-start; }
.h-bank .h-pin { letter-spacing: normal; color: var(--brand, #0e7a4b); font-weight: 700; }

.h-more-row { margin-top: auto; padding-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.h-more-row .h-more { margin-top: 0; padding-top: 0; }
@media (max-width: 640px) {
  .h-lead { font-size: 16px; margin-top: 14px; }
}
