/* ============================================================
   Home Page — Design system (minimal, airy, system UI fonts)
   Variables scoped to .home-main to avoid Bootstrap conflicts
   ============================================================ */

.home-main {
  --h-bg:        oklch(0.984 0.002 250);
  --h-surface:   #ffffff;
  --h-surface2:  oklch(0.975 0.003 250);
  --h-ink:       oklch(0.235 0.012 264);
  --h-ink-soft:  oklch(0.42  0.012 264);
  --h-muted:     oklch(0.58  0.010 264);
  --h-faint:     oklch(0.70  0.008 264);
  --h-line:      oklch(0.915 0.005 264);
  --h-line-soft: oklch(0.945 0.004 264);
  --h-ci:        #FA974E;
  --h-ci-hover:  #E8873E;
  --h-ci-soft:   rgba(250, 151, 78, 0.12);
  --h-ci-line:   #FA974E;
  --h-ok:        var(--h-ci);
  --h-ok-soft:   var(--h-ci-soft);
  --h-ok-line:   var(--h-ci-line);
  --h-radius:    14px;
  --h-radius-sm: 10px;
  --h-radius-lg: 20px;
  --h-shadow-sm: 0 1px 2px rgba(20,22,28,.04), 0 1px 3px rgba(20,22,28,.03);
  --h-shadow-md: 0 4px 16px -6px rgba(20,22,28,.10), 0 2px 6px -2px rgba(20,22,28,.05);
  --h-shadow-lg: 0 24px 60px -24px rgba(20,22,28,.20), 0 8px 24px -12px rgba(20,22,28,.10);
  --h-ease:      cubic-bezier(.22,.61,.36,1);

  font-family: var(--font-sans);
  background: var(--h-bg);
  color: var(--h-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Scoped box-sizing reset */
.home-main *, .home-main *::before, .home-main *::after {
  box-sizing: border-box;
}

/* ─── Container ──────────────────────────────────────────── */
.hcontainer {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ─── Buttons ────────────────────────────────────────────── */
.hbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid transparent;
  border-radius: var(--h-radius-sm);
  padding: 11px 20px;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all .18s var(--h-ease);
}
.hbtn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; flex-shrink: 0; }
.hbtn-primary { background: var(--h-ci); color: #fff; }
.hbtn-primary:hover { background: var(--h-ci-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--h-shadow-md); }
.hbtn-ghost { background: var(--h-surface); color: var(--h-ink-soft); border-color: var(--h-line); }
.hbtn-ghost:hover { border-color: var(--h-faint); background: var(--h-surface2); color: var(--h-ink); }
.hbtn-white { background: #fff; color: var(--h-ink); }
.hbtn-white:hover { transform: translateY(-1px); box-shadow: var(--h-shadow-md); color: var(--h-ink); }
.hbtn-lg { padding: 15px 28px; font-size: 16px; border-radius: var(--h-radius); }

/* ─── Hero ───────────────────────────────────────────────── */
.home-hero {
  padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 5vw, 60px);
  min-height: clamp(360px, 45vh, 500px);
  display: flex;
  align-items: center;
  background: var(--h-ink) url('../images/sliders/bg_01.jpg') center / cover no-repeat;
  position: relative;
  overflow: hidden;
}
.home-hero > .hcontainer { width: 100%; }
.home-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(160deg, oklch(0.14 0.020 264 / .82) 0%, oklch(0.22 0.018 264 / .68) 100%);
  pointer-events: none;
}
.home-hero .hero-grid { position: relative; z-index: 1; }
.home-hero .eyebrow { color: var(--h-ok-line); }
.home-hero .ebline  { background: var(--h-ok-line); }
.home-hero .hero-copy h1 { color: #fff; }
.home-hero .h-accent { color: var(--h-ok-line); }
.home-hero .hero-lede { color: oklch(0.88 0.010 264); }
.home-hero .hbtn-ghost {
  background: oklch(1 0 0 / .12);
  border-color: oklch(1 0 0 / .28);
  color: #fff;
}
.home-hero .hbtn-ghost:hover {
  background: oklch(1 0 0 / .20);
  border-color: oklch(1 0 0 / .45);
  color: #fff;
}
.home-hero .hero-trust { border-top-color: oklch(1 0 0 / .14); }
.home-hero .hero-trust .ti { color: oklch(0.80 0.010 264); }
.home-hero .hero-trust .ti svg { stroke: var(--h-ok-line); }

.hero-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  position: relative;
  max-width: 600px;
}

.hero-copy .hero-lede { margin-left: 0; margin-right: 0; }
.hero-copy .hero-trust { justify-content: flex-start; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--h-ok);
  margin-bottom: 22px;
}
.ebline { width: 26px; height: 1.5px; background: var(--h-ok-line); flex-shrink: 0; }

.hero-copy h1 {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--h-ink);
  margin: 0;
}
.h-accent { color: var(--h-ok); }

.hero-lede {
  margin-top: 22px;
  font-size: clamp(16px, 1.6vw, 18px);
  color: var(--h-ink-soft);
  max-width: 30em;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--h-line);
}
.hero-trust .ti {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--h-muted); font-weight: 500;
}
.hero-trust .ti svg { width: 15px; height: 15px; stroke: var(--h-ok); fill: none; flex-shrink: 0; }

/* Impact panel */
.impact-panel {
  background: var(--h-surface);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  box-shadow: var(--h-shadow-lg);
  padding: clamp(28px, 3.5vw, 40px);
  position: relative;
  overflow: hidden;
}
.impact-panel::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--h-ok), var(--h-ok-line));
}
.impact-panel .ip-grid {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--h-line-soft);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.impact-panel .ip-cell .v {
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 700; letter-spacing: -0.01em; color: var(--h-ink);
}
.impact-panel .ip-cell .v .unit {
  font-size: .55em; color: var(--h-muted); font-weight: 500; margin-left: 3px;
}
.impact-panel .ip-cell .k {
  margin-top: 3px; font-size: 12.5px; color: var(--h-muted);
}

/* ─── Section scaffolding ────────────────────────────────── */
.home-section {
  padding: clamp(54px, 7vw, 88px) 0;
  background: var(--h-bg);
}
.home-section-alt {
  background: var(--h-surface2) !important;
  border-top: 1px solid var(--h-line-soft);
  border-bottom: 1px solid var(--h-line-soft);
}

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.kicker {
  font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--h-ok); margin-bottom: 10px;
}
.sec-head h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700; letter-spacing: -0.02em;
  color: var(--h-ink); line-height: 1.2; margin: 0;
}
.sec-head p { margin-top: 10px; color: var(--h-muted); font-size: 15px; max-width: 40em; }

.sec-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600; color: var(--h-ink-soft);
  white-space: nowrap; flex-shrink: 0; text-decoration: none;
  transition: gap .18s var(--h-ease), color .18s var(--h-ease);
}
.sec-link svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.sec-link:hover { color: var(--h-ink); gap: 11px; }

/* ─── Project Cards (legacy grid) ────────────────────────── */
.proj-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

/* ─── Project Donate Cards (detail + QR) ─────────────────── */
.proj-donate-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.proj-donate-card {
  background: var(--h-surface);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  overflow: hidden;
  box-shadow: var(--h-shadow-sm);
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 0;
}

.proj-donate-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 3vw, 28px);
  background: var(--h-surface2);
  border-right: 1px solid var(--h-line-soft);
  text-align: center;
}

.proj-donate-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--h-surface2);
}

.proj-donate-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.proj-donate-body {
  padding: clamp(22px, 3vw, 32px);
  display: flex;
  flex-direction: column;
}

.proj-donate-body h3 {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--h-ink);
  margin: 0;
}

.proj-donate-desc {
  margin-top: 12px;
  font-size: 14.5px;
  color: var(--h-muted);
  line-height: 1.75;
  white-space: pre-line;
}

.tag-open {
  color: var(--h-ok) !important;
  background: var(--h-ok-soft) !important;
  border-color: var(--h-ok-line) !important;
}

.proj-qr {
  text-align: center;
}

.proj-qr-logos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.proj-qr-logo-main {
  max-width: 200px;
  width: 100%;
  border-radius: 8px;
}

.proj-qr-logo-pp {
  height: 40px;
  border: 1px solid var(--h-line);
  border-radius: 6px;
  padding: 6px 14px;
  background: #fff;
}

.proj-qr-image {
  width: 200px;
  height: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--h-radius-sm);
  padding: 8px;
  box-shadow: var(--h-shadow-sm);
}

.proj-qr-hint {
  margin: 16px 0 0;
  font-size: 13.5px;
  color: var(--h-muted);
  line-height: 1.6;
}

.proj-qr-empty {
  min-height: 280px;
  justify-content: center;
  gap: 8px;
}

.proj-qr-empty-icon {
  font-size: 2.5rem;
  color: var(--h-faint);
  margin-bottom: 8px;
}

.proj-qr-empty p {
  margin: 0;
  font-size: 14px;
  color: var(--h-muted);
}

.proj-qr-contact {
  margin-top: 8px !important;
  font-weight: 600;
  color: var(--h-ink-soft) !important;
}

/* ─── Legacy compact cards ───────────────────────────────── */

.proj-card {
  background: var(--h-surface);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  overflow: hidden;
  box-shadow: var(--h-shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform .22s var(--h-ease), box-shadow .22s var(--h-ease);
}
.proj-card:hover { transform: translateY(-4px); box-shadow: var(--h-shadow-lg); }

.proj-card-img {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--h-surface2);
}
.proj-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s var(--h-ease);
}
.proj-card:hover .proj-card-img img { transform: scale(1.04); }

.pc-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.tagrow { display: flex; gap: 8px; margin-bottom: 13px; }
.tag {
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--h-ok);
  background: var(--h-ok-soft);
  border: 1px solid var(--h-ok-line);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pc-body h3 {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  line-height: 1.35; color: var(--h-ink); margin: 0;
}
.pc-body .desc {
  margin-top: 9px; font-size: 14px; color: var(--h-muted);
  line-height: 1.65; flex: 1;
}
.pc-foot {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--h-line-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.pc-foot .give {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600; color: var(--h-ink); text-decoration: none;
  transition: gap .18s var(--h-ease);
}
.pc-foot .give svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }
.proj-card:hover .pc-foot .give { gap: 11px; }
.pc-foot .meta { font-size: 12.5px; color: var(--h-faint); }

/* ─── CTA Band ───────────────────────────────────────────── */
.home-cta-band { padding: clamp(40px, 6vw, 72px) 0; background: var(--h-bg); }
.cta-inner {
  background: var(--h-ink);
  border-radius: var(--h-radius-lg);
  padding: clamp(40px, 6vw, 64px) clamp(28px, 5vw, 64px);
  text-align: center;
  position: relative; overflow: hidden;
  box-shadow: var(--h-shadow-lg);
}
.cta-inner::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(oklch(1 0 0 / .06) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}
.cta-inner .ce {
  font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--h-ok-line); margin-bottom: 16px; position: relative;
}
.cta-inner h2 {
  font-size: clamp(26px, 3.6vw, 40px); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.18;
  color: #fff; margin: 0 auto; max-width: 16em; position: relative;
}
.cta-inner p {
  margin: 16px auto 0;
  color: oklch(0.82 0.01 264); font-size: 16px; max-width: 34em; position: relative;
}
.cta-row {
  margin-top: 32px; display: flex; flex-wrap: wrap;
  gap: 12px; justify-content: center; position: relative;
}

/* ─── Loading / Empty states ─────────────────────────────── */
.home-loading {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 60px 0;
}
.home-loading span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--h-ok);
  animation: home-bounce .8s ease-in-out infinite;
}
.home-loading span:nth-child(2) { animation-delay: .15s; }
.home-loading span:nth-child(3) { animation-delay: .30s; }
@keyframes home-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: .4; }
  40%            { transform: scale(1);   opacity: 1; }
}
.home-empty { text-align: center; color: var(--h-muted); padding: 48px 0; font-size: 15px; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .impact-panel { max-width: 520px; }
  .proj-cards { grid-template-columns: repeat(2, 1fr); }
  .proj-donate-card { grid-template-columns: 1fr; }
  .proj-donate-qr {
    border-right: none;
    border-bottom: 1px solid var(--h-line-soft);
    min-height: auto;
    padding: 24px 20px;
  }
  .proj-donate-img { aspect-ratio: 16 / 9; max-height: 260px; }
}
@media (max-width: 640px) {
  .proj-cards { grid-template-columns: 1fr; }
  .sec-head { flex-direction: column; align-items: flex-start; }
  .impact-panel .ip-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .home-main *, .home-main *::before, .home-main *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
