/* ============================================================
   HAMDAM — Base styles
   Resets, layout shells, landing-page specifics, utilities.
   Component styles live in components.css.
   Design tokens must be loaded first (tokens.css).
   ============================================================ */

/* ============================================================
   Reset & body defaults
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
p { margin: 0; }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   Layout shells
   ============================================================ */
.app {
  height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 64px 1fr;
  grid-template-areas:
    "side  top"
    "side  main";
  background: var(--bg);
}
.app.no-sidebar {
  grid-template-columns: 1fr;
  grid-template-areas: "top" "main";
}
.app > .sidebar { grid-area: side; overflow-y: auto; }
.app > .topbar  { grid-area: top; }
.app > main     { grid-area: main; padding: var(--pad-3) var(--pad-5) var(--pad-5); overflow: auto; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--pad-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 5;
  white-space: nowrap;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  gap: 4px;
}

/* Dashboard mobile-nav controls — hidden on desktop, revealed by the
   responsive layer (≤1024) where the sidebar becomes an off-canvas drawer. */
.nav-toggle { display: none; }
.nav-scrim { display: none; }

/* ============================================================
   Navigation
   ============================================================ */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-2);
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
  border: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}
.nav-item > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active {
  background: color-mix(in oklch, var(--accent) 12%, var(--surface));
  color: var(--accent);
  border-color: color-mix(in oklch, var(--accent) 22%, var(--line));
}
.nav-item .ico { width: 16px; height: 16px; flex: none; }

/* ============================================================
   Public header & footer
   ============================================================ */
.lp-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px clamp(20px, 4vw, 56px);
  max-width: 1480px;
  margin: 0 auto;
}
.lp-nav { display: flex; gap: 22px; font-size: 14px; color: var(--ink-soft); }
.lp-actions { display: flex; align-items: center; gap: 8px; }
.lp-menu-toggle { display: none; }
.lp-mobile-menu { display: none; }
.lp-mobile-menu[hidden] { display: none !important; }

.public-footer {
  border-top: 1px solid var(--line);
  padding: 40px clamp(20px, 4vw, 56px);
}
.public-footer .footer-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
.public-footer .footer-bottom {
  margin-top: 40px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}
.footer-contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.footer-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in oklch, var(--ink) 8%, transparent);
  color: var(--ink);
  text-decoration: none;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.footer-social-btn:hover {
  background: color-mix(in oklch, var(--ink) 14%, transparent);
  border-color: color-mix(in oklch, var(--ink) 18%, var(--line));
  transform: translateY(-1px);
}
.footer-social-btn svg {
  width: 20px;
  height: 20px;
}
.footer-bottom a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ============================================================
   Language toggle
   ============================================================ */
.lang-toggle {
  display: flex;
  background: var(--surface);
  border-radius: 999px;
  padding: 4px;
  border: 1px solid var(--line);
}
.lang-toggle a {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  color: var(--muted);
  text-decoration: none;
}
.lang-toggle a.active {
  background: var(--surface-2);
  color: var(--ink);
}

/* ============================================================
   Auth split layout (2-column: form left, photo right)
   ============================================================ */
.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background: var(--bg);
}
.auth-split .auth-form-side {
  padding: 40px 56px 40px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.auth-split .auth-form-side .auth-form-content {
  margin: auto 0;
  max-width: 460px;
  width: 100%;
}
.auth-split .auth-form-side .logomark {
  align-self: flex-start;
  margin-left: 56px;
}
.auth-split .auth-photo-side {
  position: relative;
  overflow: hidden;
}
.auth-split .auth-photo-side .auth-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85) saturate(0.85);
}
.auth-split .auth-photo-side .auth-overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in oklch, var(--accent) 10%, transparent);
}
.auth-split .auth-photo-side .auth-quote {
  position: absolute;
  bottom: 40px;
  left: 40px;
  right: 40px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--r-3);
  padding: 22px;
  box-shadow: var(--shadow-lg);
}
.auth-split .auth-photo-side .auth-credit {
  position: absolute;
  bottom: 12px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.85);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  text-decoration: none;
}
.auth-split .auth-photo-side .auth-credit:hover {
  background: rgba(0,0,0,0.65);
}

/* ============================================================
   Landing page specifics
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: var(--pad-5);
  align-items: center;
  padding: var(--pad-6) var(--pad-5) var(--pad-5);
  max-width: 1400px;
  margin: 0 auto;
}
.hero > * {
  min-width: 0;
}
.hero .photo { aspect-ratio: 4 / 5; min-height: 420px; }
.hero-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  min-height: 420px;
  margin: 0;
  border-radius: var(--r-3);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-photo-credit {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.86);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  text-decoration: none;
}
.hero-photo-credit:hover {
  background: rgba(0,0,0,0.65);
}
.hero-quote {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  color: var(--ink);
  background: color-mix(in oklch, var(--surface) 84%, transparent);
  border: 1px solid color-mix(in oklch, var(--line) 76%, transparent);
  border-radius: var(--r-3);
  padding: 20px 22px;
  box-shadow: var(--shadow-lg);
}
.quote-stack {
  min-width: 0;
}
.hero-quote-main {
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1.22;
  margin: 0;
}
.hero-quote-author {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0;
  margin-top: 10px;
  text-transform: uppercase;
}
.quote-item {
  display: none;
  margin: 0;
}
.quote-item.is-active {
  display: block;
}
.hero-stats {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
  max-width: 620px;
}

.section { padding: var(--pad-5); max-width: 1400px; margin: 0 auto; }

/* Responsive grid utilities from the design prototype. */
.stat-grid   { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.split-grid  { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.grid-3      { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2      { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.proj-grid   { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.fund-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 8px;
}
.fund-dots { display: none; }
.story-grid  { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: stretch; }
.story-grid > * { min-width: 0; }
.story-panel {
  position: relative;
  min-height: 380px;
  border: 1px solid color-mix(in oklch, var(--accent) 20%, var(--line));
  border-radius: var(--r-4);
  background:
    linear-gradient(135deg,
      color-mix(in oklch, var(--accent) 13%, var(--surface)) 0%,
      color-mix(in oklch, var(--accent-2) 14%, var(--surface)) 100%);
  color: var(--ink);
  padding: 56px 48px 104px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.story-kicker {
  color: color-mix(in oklch, var(--accent) 78%, var(--ink-soft));
  margin-bottom: clamp(56px, 8vw, 104px);
}
.story-title {
  color: var(--ink);
  font-size: 44px;
  line-height: 1.05;
  margin-bottom: 20px;
  max-width: 680px;
}
.story-copy {
  color: var(--ink-soft);
  max-width: 520px;
  font-size: 16px;
  line-height: 1.6;
}
.btn.story-cta {
  position: absolute;
  right: 32px;
  bottom: 32px;
  background: var(--surface);
  color: var(--ink);
  border-color: color-mix(in oklch, var(--line) 65%, transparent);
  box-shadow: var(--shadow-md);
}
.btn.story-cta:hover {
  background: var(--surface-2);
}
.story-collage {
  position: relative;
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  background: var(--surface-2);
  overflow: hidden;
  isolation: isolate;
}
.story-collage img {
  position: absolute;
  display: block;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}
.story-collage-main {
  inset: 0 auto 0 0;
  width: 78%;
  height: 100%;
  border-radius: var(--r-4);
  object-position: 50% 52%;
}
.story-collage-side {
  right: 5%;
  width: 34%;
  aspect-ratio: 1;
  border: 2px solid var(--bg);
  border-radius: 999px;
}
.story-collage-side-top {
  top: 6%;
  object-position: 50% 50%;
}
.story-collage-side-middle {
  top: 36%;
  object-position: 50% 50%;
}
.story-collage-side-bottom {
  bottom: 6%;
  object-position: 46% 44%;
}
.story-collage .label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0;
  text-transform: uppercase;
  background: color-mix(in oklch, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px 10px;
  color: var(--ink-soft);
  max-width: calc(100% - 24px);
}
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.donate-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 36px; align-items: start; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  flex-wrap: wrap;
  row-gap: 4px;
}
.kicker::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: currentColor;
}

/* Logomark */
.logomark {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.logomark-img {
  height: 32px;
  width: auto;
  display: inline-block;
  object-fit: contain;
}
[data-mode="dark"] .logomark-img {
  filter: brightness(0) invert(1) opacity(0.92);
}
.logomark-word {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.logomark .glyph {
  width: 32px; height: 32px; border-radius: 7px;
  background: var(--ink);
  color: var(--surface);
  align-items: center; justify-content: center;
  font-size: 18px;
  font-family: var(--font-display);
  position: relative;
}
.logomark .glyph::after {
  content: ''; position: absolute; inset: 4px;
  border: 1px solid color-mix(in oklch, var(--surface) 70%, transparent);
  border-radius: 4px;
}

/* ============================================================
   Project grid
   ============================================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

/* ============================================================
   About impact stats
   ============================================================ */
.about-impact-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--pad-4);
}
.about-impact-head {
  justify-content: space-between;
  align-items: end;
  gap: var(--pad-3);
  margin-bottom: var(--pad-3);
}
.about-impact-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin: 0;
}
.about-impact-source {
  margin-bottom: 4px;
  white-space: nowrap;
  color: var(--ink-soft);
}
.about-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.about-stat {
  position: relative;
  min-height: 150px;
  padding: 18px 16px;
  background: var(--surface-2);
  border-color: var(--line-soft);
  overflow: hidden;
}
.about-stat::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--about-stat-color, var(--accent));
}
.about-stat[data-tone="education"] {
  --about-stat-color: var(--accent);
}
.about-stat[data-tone="it"] {
  --about-stat-color: var(--accent-2);
}
.about-stat[data-tone="social"] {
  --about-stat-color: var(--warning);
}
.about-stat[data-tone="care"] {
  --about-stat-color: var(--success);
}
.about-stat .v {
  font-size: clamp(28px, 2.4vw, 38px);
  color: var(--ink);
  white-space: nowrap;
}
.about-stat .l {
  letter-spacing: 0;
  line-height: 1.25;
}
.about-stat .d {
  line-height: 1.35;
}

/* ============================================================
   Filter bar
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.filter-separator {
  width: 1px;
  height: 22px;
  background: var(--line);
}

/* ============================================================
   Project detail
   ============================================================ */
.project-detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
}
.project-detail-grid aside .card {
  position: sticky;
  top: 24px;
}
.tab-bar {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.tab-bar a {
  padding: 12px 0;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  text-transform: capitalize;
  font-size: 14px;
  margin-bottom: -1px;
  text-decoration: none;
}
.tab-bar a.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.progress-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

/* ============================================================
   Empty state
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--pad-6) var(--pad-4);
  color: var(--muted);
}
.empty-state h2 {
  color: var(--ink-soft);
  font-size: 28px;
  margin-bottom: 12px;
}
.empty-state p {
  max-width: 480px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.6;
}

/* ============================================================
   Utility classes
   ============================================================ */
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1 1 auto; }
.right { margin-left: auto; }
.muted { color: var(--muted); }
.ink-soft { color: var(--ink-soft); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11.5px; }
.mb1 { margin-bottom: 8px; } .mb2 { margin-bottom: 14px; } .mb3 { margin-bottom: 22px; } .mb4 { margin-bottom: 32px; }
.mt1 { margin-top: 8px; } .mt2 { margin-top: 14px; } .mt3 { margin-top: 22px; } .mt4 { margin-top: 32px; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--pad-3);
}
.contact-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
  padding: var(--pad-3);
}
.contact-link-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 1.6;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .split-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .fund-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .about-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .lp-footer-grid { grid-template-columns: 1fr 1fr !important; gap: 24px 28px !important; }
  .hero {
    grid-template-columns: 1fr;
    gap: var(--pad-4);
    padding: var(--pad-5) 20px var(--pad-4);
  }
  .hero .photo {
    min-height: 340px;
    aspect-ratio: 16 / 11;
  }
  .hero-photo {
    min-height: 340px;
    aspect-ratio: 16 / 11;
  }
  .hero-quote {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 16px 18px;
  }
  .hero-quote-main {
    font-size: 20px;
  }
  .section { padding: var(--pad-4) 20px; }
  .story-grid,
  .detail-grid,
  .donate-grid {
    grid-template-columns: 1fr;
  }
  .story-panel {
    min-height: 340px;
    padding: 42px 36px 92px;
  }
  .story-kicker {
    margin-bottom: 48px;
  }
  .story-title {
    font-size: 40px;
  }
  .btn.story-cta {
    right: 28px;
    bottom: 28px;
  }
  .story-collage {
    min-height: 430px;
  }
  .story-collage-main {
    width: 74%;
  }
  .story-collage-side {
    right: 5%;
    width: 31%;
  }
  .cta-card {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: var(--pad-5) !important;
  }
  .project-detail-grid {
    grid-template-columns: 1fr;
  }
  .project-detail-grid aside .card {
    position: static;
  }
  .detail-grid aside .card {
    position: static !important;
  }

  .lp-header {
    flex-wrap: wrap;
  }
  .lp-nav,
  .lp-tagline {
    display: none;
  }
  .lp-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--r-2);
    cursor: pointer;
    color: var(--ink);
  }
  .lp-menu-toggle:hover {
    background: var(--surface-2);
  }
  .lp-mobile-menu.is-open {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    border-top: 1px solid var(--line-soft);
    margin-top: 10px;
    padding-top: 4px;
  }
  .lp-mobile-menu a {
    padding: 12px 4px;
    font-size: 15px;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line-soft);
  }
  .lp-mobile-lang,
  .lp-mobile-actions {
    display: none;
  }
  .auth-split {
    grid-template-columns: 1fr;
  }
  .auth-split .auth-photo-side {
    display: none;
  }
  .auth-split .auth-form-side {
    padding: var(--pad-4) var(--pad-3);
  }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .grid-2,
  .grid-3,
  .form-grid-2,
  .form-grid-3,
  .proj-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .about-impact-head {
    align-items: flex-start;
  }
  .about-impact-source {
    white-space: normal;
  }
  .about-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .about-stat {
    min-height: 138px;
    padding: 16px 14px;
  }
  .contact-grid { grid-template-columns: 1fr; }
  .public-footer .footer-grid { grid-template-columns: 1fr; }
  .lp-footer-grid { grid-template-columns: 1fr !important; }
  .section { padding: var(--pad-4) 20px; }
  h1 { font-size: clamp(34px, 9vw, 46px); }
  .stat .v { font-size: clamp(22px, 7vw, 30px); }
  .btn { height: 44px; }
  .btn.sm { height: 36px; }
  .btn.lg { height: 52px; }

  .fund-grid {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px;
    max-width: 100%;
    margin-inline: 0;
    padding: 4px 0;
    scroll-padding-left: 0;
    scrollbar-width: none;
  }
  .fund-grid::-webkit-scrollbar {
    display: none;
  }
  .fund-grid > .card {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }
  .fund-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
  }
  .fund-dots button {
    width: 7px;
    height: 7px;
    padding: 0;
    border-radius: 999px;
    border: none;
    background: var(--line);
    cursor: pointer;
    transition: background 160ms ease, width 160ms ease;
  }
  .fund-dots button[aria-current="true"] {
    background: var(--accent);
    width: 20px;
  }

  .hero-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn,
  .cta-card .btn {
    width: 100%;
    justify-content: center;
  }
  .story-panel {
    min-height: 0;
    padding: 32px 24px 24px;
  }
  .story-kicker {
    margin-bottom: 48px;
  }
  .story-title {
    font-size: 34px;
  }
  .btn.story-cta {
    position: static;
    width: 100%;
    justify-content: center;
    margin-top: 28px;
  }
  .cta-card {
    padding: var(--pad-4) !important;
  }
  .cta-card h2 {
    font-size: 32px !important;
  }
  .story-collage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-height: 0;
    padding: 10px;
  }
  .story-collage img {
    position: static;
    width: 100%;
    height: 122px;
    aspect-ratio: auto;
    border: 0;
    border-radius: var(--r-2);
    box-shadow: none;
  }
  .story-collage-main {
    grid-column: 1 / -1;
    height: 250px;
    border-radius: var(--r-3);
  }
  .story-collage-side-bottom {
    grid-column: 1 / -1;
    height: 150px;
  }
  .story-collage .label {
    position: static;
    grid-column: 1 / -1;
    max-width: none;
  }
  .hero-quote {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 14px 16px;
  }
  .hero-photo {
    min-height: 0;
    width: 100%;
    aspect-ratio: 4 / 5;
  }
  .hero-quote-main {
    font-size: 18px;
    line-height: 1.2;
  }
  .p-card .p-foot {
    flex-wrap: wrap;
  }
  .p-card .p-foot .of {
    margin-left: 0;
  }
  .lp-header { padding: 14px 20px; }
  .lp-actions { display: none; }
  .lp-mobile-lang {
    display: flex;
    padding: 12px 4px 8px;
  }
  .lp-mobile-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
  }
  .lp-mobile-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .row.wrap-mobile { flex-wrap: wrap; }
}

/* ============================================================
   Responsive — dashboard app shell (off-canvas sidebar)
   ------------------------------------------------------------
   On ≤1024 the 260px sidebar leaves the grid and becomes a fixed
   drawer slid off-screen; the hamburger in the TopBar toggles
   `body.nav-open`, a scrim closes it. Shared by every dashboard
   (admin, sponsor, teacher, student, system).
   ============================================================ */
@media (max-width: 1024px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 64px 1fr;
    grid-template-areas: "top" "main";
  }
  .app > .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 270px;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 260ms cubic-bezier(.2, .7, .2, 1);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
  }
  body.nav-open .app > .sidebar { transform: none; }
  .app > main { padding: var(--pad-3) 20px var(--pad-4); }

  .nav-scrim {
    display: block;
    position: fixed; inset: 0;
    background: oklch(0.2 0.02 60 / 0.4);
    z-index: 69;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }

  .nav-toggle {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 40px; height: 40px;
    flex: none;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--r-2);
    cursor: pointer;
    color: var(--ink);
  }
  .nav-toggle:hover { background: var(--surface-2); }
}

/* Lock body scroll while the mobile nav drawer is open */
body.nav-open { overflow: hidden; }
@media (min-width: 1025px) {
  /* never lock / never show scrim on desktop, even if the class lingers */
  body.nav-open { overflow: auto; }
}

@media (max-width: 640px) {
  /* Safety net: collapse ANY inline multi-column grid inside a dashboard
     shell or modal to a single column on phones. !important overrides the
     inline styles many screens still set. Prefer the .stat-grid/.grid-2/
     .form-grid-* utilities for new code; this catches the rest. */
  .app main [style*="grid-template-columns"],
  .modal-dialog [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* TopBar: tighten padding, hide the long username (keep avatar) */
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .user-name { display: none; }

  /* Tabs / segmented rows scroll horizontally instead of wrapping tall */
  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; }
}
