/* =========================================================
   BEHIND RANDOMVERSE / FOUNDER
   ========================================================= */

.founder {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* =========================================================
   BACKGROUND ATMOSPHERE
   ========================================================= */

.founder__glow {
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: -1;
}

.founder__glow--one {
  top: 5%;
  left: -20%;
  background: var(--primary);
  opacity: 0.09;
  animation: founder-drift-one 16s ease-in-out infinite;
}

.founder__glow--two {
  right: -18%;
  bottom: -20%;
  background: var(--secondary);
  opacity: 0.055;
  animation: founder-drift-two 19s ease-in-out infinite;
}

/* =========================================================
   LAYOUT
   ========================================================= */

/* English: Content left, portrait right */
[dir="ltr"] .founder__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  grid-template-areas: "content portrait";
  align-items: center;
  gap: clamp(55px, 8vw, 110px);
  direction: ltr;
}

[dir="ltr"] .founder__content {
  grid-area: content;
  direction: ltr;
  text-align: left;
}

[dir="ltr"] .founder__portrait {
  grid-area: portrait;
  direction: ltr;
}

/* Arabic: Portrait left, content right */
[dir="rtl"] .founder__layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  grid-template-areas: "portrait content";
  align-items: center;
  gap: clamp(55px, 8vw, 110px);
  direction: ltr;
}

[dir="rtl"] .founder__portrait {
  grid-area: portrait;
  direction: rtl;
}

[dir="rtl"] .founder__content {
  grid-area: content;
  direction: rtl;
  text-align: right;
}

/* =========================================================
   PORTRAIT
   ========================================================= */

.founder__portrait {
  position: relative;
  width: 100%;
  max-width: 410px;
  justify-self: center;
}

.founder__portrait-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius-xl);

  background: linear-gradient(
    145deg,
    var(--surface),
    var(--background-variant)
  );

  border: 1px solid rgba(255, 255, 255, 0.09);

  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.35),
    0 0 60px rgba(103, 24, 217, 0.09);
}

.founder__portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;

  background: linear-gradient(180deg, transparent 65%, rgba(10, 11, 18, 0.22));

  pointer-events: none;
}

.founder__portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 700ms var(--ease-standard);
}

.founder__portrait:hover img {
  transform: scale(1.035);
}

/* =========================================================
   PORTRAIT CAPTION
   ========================================================= */

.founder__portrait-caption {
  display: block;
  margin-top: 20px;
  color: var(--disabled-text);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  text-align: center;
}

/* =========================================================
   CONTENT
   ========================================================= */

.founder__content {
  max-width: 650px;
}

.founder__content .section-title {
  max-width: 650px;
  font-size: clamp(2.7rem, 4.5vw, 3.8rem);
}

.founder__content .section-title .gradient-text {
  display: inline;
}

.founder__description {
  max-width: 620px;
  margin-top: 25px;
  color: var(--secondary-text);
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  line-height: 1.8;
}

.founder__description + .founder__description {
  margin-top: 16px;
}

/* =========================================================
   IDENTITY
   ========================================================= */

.founder__identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-top: 38px;
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.founder__name {
  color: var(--primary-text);
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.founder__role {
  color: var(--secondary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* =========================================================
   SOCIAL LINKS
   ========================================================= */

.founder__links {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}

.founder__links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;

  transition:
    color 0.25s ease,
    transform 0.25s ease;
}

.founder__links a:hover {
  color: var(--color-cyan);
  transform: translateY(-2px);
}

.founder__links a:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 4px;
  border-radius: 3px;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes founder-drift-one {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(30px, 25px, 0);
  }
}

@keyframes founder-drift-two {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(-30px, -25px, 0);
  }
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {
  .founder__layout {
    gap: 45px;
  }

  .founder__content .section-title {
    font-size: 2.8rem;
  }

  .founder__portrait {
    max-width: 340px;
  }
}

/* =========================================================
MOBILE
========================================================= */

@media (max-width: 800px) {
  [dir="ltr"] .founder__layout,
  [dir="rtl"] .founder__layout {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-areas: none;
    align-items: stretch;
    gap: 38px;
  }

  /* Full text section first */
  .founder__content {
    order: 1;
    width: 100%;
    max-width: 100%;
    grid-area: auto;
  }

  [dir="ltr"] .founder__content {
    text-align: left;
  }

  [dir="rtl"] .founder__content {
    text-align: right;
  }

  .founder__content .section-title {
    font-size: 2.7rem;
  }

  /* Portrait and identity underneath */
  .founder__portrait {
    order: 2;
    width: min(100%, 340px);
    max-width: none;
    align-self: center;
    grid-area: auto;
  }

  .founder__portrait-caption {
    text-align: center;
  }

  .founder__identity {
    margin-top: 30px;
  }

  .founder__links {
    justify-content: flex-start;
  }
}

/* =========================================================
SMALL MOBILE
========================================================= */

@media (max-width: 520px) {
  [dir="ltr"] .founder__layout,
  [dir="rtl"] .founder__layout {
    gap: 32px;
  }

  .founder__portrait {
    width: min(100%, 290px);
  }

  .founder__content .section-title {
    font-size: 2.35rem;
  }

  .founder__description {
    margin-top: 20px;
    font-size: 1rem;
    line-height: 1.75;
  }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .founder__glow,
  .founder__portrait-frame img {
    animation: none;
    transition: none;
  }
}
