:root{
  --ink: #132042;
  --muted: rgba(19, 32, 66, 0.65);
}

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

html, body{
  min-height: 100%;
  margin: 0;
  background: linear-gradient(
    180deg,
    #7096D1 0%,
    #a7c7e7 30%,
    #d0e3ff 60%,
    #f5f9ff 100%
  );
}

body{
  font-family: "Nunito Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
}

/* Wrapper so we can match About page horizontal rhythm */
.mentors-page{
  padding-top: 110px;
  min-height: 100vh;
}

.content{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;

  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 60px) 8vw clamp(40px, 6vw, 80px);
}

/* underline animation */
@keyframes underlineSweep{
  0%   { transform: scaleX(0); opacity: 0; }
  30%  { transform: scaleX(1); opacity: 1; }
  70%  { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(0); opacity: 0; }
}

/* Main page title */
.page-title{
  width: 100%;
  margin: 0 0 12px;

  font-size: clamp(36px, 6vw, 52px);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);

  position: relative;
  display: inline-block;   /* underline matches text width */
  padding-bottom: 10px;
  text-align: left;
}

/* underline only under the word */
.page-title::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;

  height: 3px;
  width: 100%;
  background: linear-gradient(
    90deg,
    #ffffff 0%,
    #7096D1 35%,
    #305bb3 100%
  );
  border-radius: 999px;

  transform-origin: left center;
  animation: underlineSweep 4.5s ease-in-out infinite;
}

/* Section title under it */
.section-title{
  width: 100%;
  margin: 4px 0 20px;

  font-size: clamp(22px, 3.2vw, 30px);
  font-weight: 600;
  font-style: italic;
  color: rgba(19, 32, 66, 0.75);
  text-align: left;
}


.description{
  width: 100%;
  margin: 0 0 28px;
  font-size: 17px;
  font-style: italic;
  color: var(--muted);
}

/* ===== your existing flip-card styles (kept) ===== */
.card{
  color: inherit;
  text-decoration: none;
  cursor: pointer;

  width: calc(33.333% - 2rem);
  min-width: calc(33.333% - 2rem);
  height: 400px;
  perspective: 1000px;
  margin: 1rem;
  position: relative;
  display: block;
}

@media (max-width: 800px){
  .card{
    width: calc(50% - 2rem);
    min-width: calc(50% - 2rem);
  }
}
@media (max-width: 500px){
  .card{
    width: 100%;
    min-width: 100%;
  }
}

.card-inner{
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 600ms ease-in-out;
  border-radius: 10px;
}

.card:hover .card-inner{
  transform: rotateY(180deg);
}

.card:nth-of-type(even):hover .card-inner{
  transform: rotateY(-180deg);
}

.front,
.back{
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;

  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  overflow: hidden;
}

.front{
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-position: center;
  background-size: cover;
  padding: 2rem;
  color: #fff;
  font-family: "Nunito Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.front::before{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(112, 150, 209, 0.9), rgba(48, 91, 179, 0.9));
  opacity: 0.35;
  z-index: 0;
}

.front-text{
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.front-sub{
  display: inline-block;
  font-weight: 500;
  font-size: 1rem;
  opacity: 0.95;
  margin-top: 0.4rem;
}

.back{
  background: rgba(255,255,255,0.96);
  transform: rotateY(180deg);
  padding: 1.25rem;
}

.card:nth-of-type(even) .back{
  transform: rotateY(-180deg);
}

.back-inner{
  width: 100%;
  height: 100%;
  transform: translateZ(1px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.name{
  margin: 0.25rem 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  color: var(--ink);
}

.title{
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.75;
  text-align: center;
}

.back-scroll{
  margin-top: 0.5rem;
  width: 100%;
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.75rem;
  border-radius: 10px;
  background: rgba(0,0,0,0.03);
  line-height: 1.45;
  color: #1b2b2e;
}

.back-scroll p{
  margin: 0 0 0.75rem;
}

.back-scroll ul{
  margin: 0.25rem 0 0;
  padding-left: 1.15rem;
}

.back-scroll li{
  margin: 0.35rem 0;
}

.front-content{
  position: relative;
  z-index: 1; /* above gradient overlay */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.mentor-headshot{
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;

  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 26px rgba(0,0,0,0.25);
  background: rgba(255,255,255,0.25);
}