/**
 * FOUNDER POPUPS
 * OkaneGroup Theme
 *
 * Same aesthetic as menu overlay.
 * Scroll fix: min-height:0 on grid child + overflow-y:auto.
 * Mobile: 50/50 image + role/name header, bio below.
 */

/* ═══ Overlay ═══ */
.founder-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  pointer-events: none;
  visibility: hidden;
}

.founder-overlay.is-visible {
  pointer-events: all;
  visibility: visible;
}

.founder-overlay.is-open .founder-panel {
  clip-path: inset(0% 0% 0% 0% round 50px);
}


/* ═══ Backdrop ═══ */
.founder-overlay .founder-backdrop {
  position: absolute;
  inset: 0;
  background: #0F0E0C;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.founder-overlay.is-open .founder-backdrop { opacity: 1; }
.founder-overlay.is-open .founder-close { opacity: 1; }


/* ═══ Panel ═══ */
.founder-overlay .founder-panel {
  position: relative;
  width: calc(100vw - clamp(16px, 2vw, 40px));
  height: calc(100vh - clamp(16px, 2vh, 40px));
  max-width: 1800px;
  background: #1c1a17;
  border-radius: 50px;
  display: grid;
  grid-template-columns: 1fr 44%;
  grid-template-rows: 1fr;
  overflow: hidden;
  clip-path: inset(50% 50% 50% 50% round 50px);
  transition: clip-path 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}


/* ═══ Left column — scrollable text ═══ */
.founder-overlay .founder-left {
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 3.5vw, 52px) clamp(24px, 3.5vw, 52px);
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.founder-overlay .founder-left::-webkit-scrollbar {
  width: 4px;
}

.founder-overlay .founder-left::-webkit-scrollbar-track {
  background: transparent;
}

.founder-overlay .founder-left::-webkit-scrollbar-thumb {
  background: rgba(244, 239, 231, 0.15);
  border-radius: 4px;
}


/* ── Header: role + name (desktop = stacked) ── */
.founder-overlay .founder-header {
  flex-shrink: 0;
  margin-bottom: clamp(20px, 2.5vw, 36px);
}

/* Mobile image — hidden on desktop */
.founder-overlay .founder-left__img {
  display: none;
}

.founder-overlay .founder-role {
  display: block;
  font-family: 'Host Grotesk', sans-serif;
  font-size: clamp(11px, 0.9vw, 14px);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(244, 239, 231, 0.4) !important;
  margin-bottom: 8px;
}

.founder-overlay .founder-name {
  font-family: 'Host Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #F4EFE7 !important;
  margin: 0;
}


/* ── Bio ── */
.founder-overlay .founder-bio {
  max-width: 580px;
}

.founder-overlay .founder-bio p {
  font-family: 'Host Grotesk', sans-serif;
  font-size: clamp(14px, 1.1vw, 17px);
  font-weight: 400;
  line-height: 1.7;
  color: rgba(244, 239, 231, 0.6) !important;
  margin: 0 0 clamp(14px, 1.2vw, 20px);
}

.founder-overlay .founder-bio p:last-child {
  margin-bottom: 0;
}

.founder-overlay .founder-bio .founder-quote {
  font-style: italic;
  color: rgba(244, 239, 231, 0.75) !important;
  border-left: 2px solid rgba(244, 239, 231, 0.15);
  padding-left: clamp(12px, 1.2vw, 20px);
  margin: clamp(16px, 1.5vw, 24px) 0;
}


/* ═══ Right column — image (desktop) ═══ */
.founder-overlay .founder-right {
  padding: clamp(8px, 0.9vw, 16px);
  display: flex;
  min-height: 0;
}

.founder-overlay .founder-img-wrapper {
  position: relative;
  width: 100%;
  border-radius: 50px;
  overflow: hidden;
  flex: 1;
}

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


/* ═══ Close button ═══ */
.founder-overlay .founder-close {
  position: absolute;
  top: calc(clamp(8px, 0.9vw, 16px) + 14px);
  right: calc(clamp(8px, 0.9vw, 16px) + 18px);
  z-index: 10;
  background: rgba(28, 26, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f0ece4 !important;
  width: clamp(34px, 2.8vw, 46px);
  height: clamp(34px, 2.8vw, 46px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s ease, background 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.founder-overlay .founder-close:hover {
  background: rgba(50, 46, 40, 0.92);
}

.founder-overlay .founder-close svg {
  width: clamp(13px, 1.1vw, 18px);
  height: clamp(13px, 1.1vw, 18px);
}


/* ═══ TABLET (769–1100px) ═══ */
@media (min-width: 769px) and (max-width: 1100px) {
  .founder-overlay .founder-panel {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 380px;
    height: calc(100dvh - 32px);
    max-height: none;
    overflow: hidden;
  }

  .founder-overlay .founder-left {
    grid-row: 1;
    padding: clamp(32px, 4vw, 52px) clamp(32px, 4vw, 52px) 24px;
  }

  .founder-overlay .founder-right {
    grid-row: 2;
    padding: 0 clamp(8px, 0.9vw, 16px) clamp(8px, 0.9vw, 16px);
  }

  .founder-overlay .founder-close {
    top: 14px;
    right: 14px;
  }
}


/* ═══ MOBILE (≤768px) ═══ */
@media (max-width: 768px) {
  .founder-overlay.is-open .founder-panel {
    clip-path: inset(0% 0% 0% 0% round 15px);
  }

  .founder-overlay .founder-panel {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    width: calc(100vw - 20px);
    height: calc(100dvh - 20px);
    max-height: none;
    border-radius: 15px;
    clip-path: inset(50% 50% 50% 50% round 15px);
  }

  /* Hide desktop image column */
  .founder-overlay .founder-right {
    display: none;
  }

  .founder-overlay .founder-left {
    grid-row: 1;
    padding: 20px 20px;
  }

  /* ── Header: 50% image + 50% role/name side by side ── */
  .founder-overlay .founder-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
  }

  .founder-overlay .founder-left__img {
    display: block;
    width: 50%;
    flex-shrink: 0;
    aspect-ratio: 3/4;
    border-radius: 15px;
    overflow: hidden;
  }

  .founder-overlay .founder-left__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
  }

  .founder-overlay .founder-header__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .founder-overlay .founder-name {
    font-size: clamp(1.4rem, 5.5vw, 1.8rem);
  }

  .founder-overlay .founder-role {
    font-size: clamp(9px, 2.5vw, 12px);
  }

  .founder-overlay .founder-bio {
    max-width: 100%;
  }

  .founder-overlay .founder-img-wrapper {
    border-radius: 15px;
  }

  .founder-overlay .founder-close {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
  }
}
