/* ==========================================================
   SoftBlock - Leadership section (standalone)
   Same theme tokens as the main page (light + dark).
   Dark mode follows <html data-theme="dark"> or the OS setting,
   exactly like the main page's theme toggle.
   Prefix: ld-  (no clash with the rest of the site, no Bootstrap needed)
   ========================================================== */

/* ---------- Theme tokens (copied from main page) ---------- */
.ld-section {
  --bg: #f5f4fb;
  --fg: #0b1030;
  --muted: #555b7a;
  --card: rgba(255, 255, 255, 0.7);
  --line: rgba(11, 16, 48, 0.12);
  --a: #2b3bff;
  --b: #8a2be2;
  --c: #ff2d87;
  --grad: linear-gradient(110deg, #2b3bff, #8a2be2 50%, #ff2d87);
  --ld-shadow: 0 30px 60px -30px rgba(20, 20, 80, 0.25);
  --ld-shadow-hover: 0 20px 40px -20px rgba(138, 43, 226, 0.4);
  --ld-radius: 22px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ld-section {
    --bg: #070a1f;
    --fg: #f2f3ff;
    --muted: #9aa0c7;
    --card: rgba(20, 24, 60, 0.6);
    --line: rgba(255, 255, 255, 0.12);
  }
}

:root[data-theme="dark"] .ld-section {
  --bg: #070a1f;
  --fg: #f2f3ff;
  --muted: #9aa0c7;
  --card: rgba(20, 24, 60, 0.6);
  --line: rgba(255, 255, 255, 0.12);
}

/* ---------- Section ---------- */
.ld-section {
  position: relative;
  padding: 100px 24px;
  background: var(--bg);
  color: var(--fg);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.ld-section *,
.ld-section *::before,
.ld-section *::after {
  box-sizing: border-box;
}

.ld-container {
  max-width: 1140px;
  margin: 0 auto;
}

/* ---------- Heading ---------- */
.ld-head {
  text-align: center;
  margin-bottom: 64px;
}

.ld-title {
  margin: 0 0 16px;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}

.ld-sub {
  max-width: 600px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* ---------- Cards ---------- */
.ld-card {
  position: relative;
  overflow: hidden;
  padding: 28px 22px;
  border: 1px solid var(--line);
  border-radius: var(--ld-radius);
  background: var(--card);
  color: var(--fg);
  box-shadow: var(--ld-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-align: center;
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease,
    border-color 0.4s ease;
}

.ld-card > * {
  position: relative;
  z-index: 1;
}

/* spotlight that follows the mouse (--mx / --my set by JS) */
.ld-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(138, 43, 226, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* gradient line that grows on hover */
.ld-card::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: var(--grad);
  transition: width 0.5s ease;
}

.ld-card:hover {
  transform: translateY(-5px);
  border-color: var(--b);
  box-shadow: var(--ld-shadow-hover);
}

.ld-card:hover::before {
  opacity: 1;
}

.ld-card:hover::after {
  width: 100%;
}

/* ---------- Photo (initials show if the image is missing) ---------- */
.ld-photo {
  position: relative;
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  margin: 0 auto 1.4rem;
  border: 4px solid transparent;
  border-radius: 50%;
  overflow: hidden;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    var(--grad) border-box;
  color: var(--b);
  font-size: 38px;
  font-weight: 800;
}

.ld-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.ld-name {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.ld-role {
  margin: 0 0 1rem;
  color: var(--c);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ld-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- Level 1: Founder (wide, horizontal) ---------- */
.ld-founder {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 40px;
  max-width: 920px;
  margin: 0 auto 28px;
  padding: 36px 44px;
  text-align: left;
}

.ld-founder .ld-photo {
  width: 180px;
  height: 180px;
  margin: 0;
  font-size: 48px;
}

.ld-founder .ld-name {
  font-size: 2rem;
}

.ld-founder .ld-desc {
  font-size: 1.02rem;
  line-height: 1.7;
}

/* ---------- Level 2: Leadership team (CSS grid) ----------
   Desktop: 3 per row, tablet: 2 per row, mobile: 1 per row.
   Built on a 6-column track (each card spans 2) so an incomplete
   last row (1 or 2 cards) can be centered. Cards in a row are
   always equal height (grid default: align-items stretch). */
.ld-grid {
  --ld-gap: 28px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--ld-gap);
}

.ld-grid .ld-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 400px;
}

/* Desktop: center an incomplete last row */
@media (min-width: 992px) {
  /* last row has 1 card */
  .ld-grid .ld-card:last-child:nth-child(3n + 1) {
    grid-column: 3 / span 2;
  }
  /* last row has 2 cards */
  .ld-grid .ld-card:nth-last-child(2):nth-child(3n + 1) {
    grid-column: 2 / span 2;
  }
  .ld-grid .ld-card:last-child:nth-child(3n + 2) {
    grid-column: 4 / span 2;
  }
}

/* ---------- Scroll reveal (only when JS is running) ---------- */
.ld-js .ld-card {
  opacity: 0;
  transform: translateY(36px);
}

.ld-js .ld-card.is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.8s ease,
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    border-color 0.4s ease;
}

.ld-js .ld-card.is-in:hover {
  transform: translateY(-5px);
}

/* ---------- Responsive ---------- */
/* Tablet: 2 per row (4 tracks, each card spans 2), lone last card centered */
@media (min-width: 576px) and (max-width: 991px) {
  .ld-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .ld-grid .ld-card:last-child:nth-child(odd) {
    grid-column: 2 / span 2;
  }
}

@media (max-width: 760px) {
  .ld-founder {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 30px 22px;
    text-align: center;
  }
  .ld-founder .ld-photo {
    margin: 0 auto;
  }
}

/* Mobile: 1 per row */
@media (max-width: 575px) {
  .ld-section {
    padding: 70px 16px;
  }
  .ld-grid {
    grid-template-columns: 1fr;
  }
  .ld-grid .ld-card {
    grid-column: auto;
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ld-card,
  .ld-card::before,
  .ld-card::after {
    transition: none !important;
  }
  .ld-js .ld-card {
    opacity: 1;
    transform: none;
  }
}
