/* About light contrast section (v3.5 – fixed tablet layout + image cropping) */

:root {
  --ink: #212529;
  --muted: #6c757d;
  --accent: #0d6efd;
  --accent-2: #6f42c1;
  --qs-blue: #00BFFF;
  --maxw: 880px;
  --bg-light: #f8f9fa;
  --card-bg: #ffffff;
  --border-color: #dee2e6;
}

.about-section {
  background-color: var(--bg-light);
  color: var(--ink);
  padding: clamp(2.2rem, 5.5vw, 4rem) 0;
  position: relative;
  overflow: hidden;
}

.about-container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(2rem, 5vw, 4rem);
}

.section-title {
  text-align: center;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin: 0;
}

/* Base grid – desktop 2x2 */
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: clamp(3.8rem, 7vw, 70px);
}

/* Cards */
.about-card {
  position: relative;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 0.1),
    0 2px 4px -2px rgb(0 0 0 / 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Aspect ratio for large screens */
.about-card::before {
  content: "";
  display: block;
  padding-top: 50%;
}

.about-card .card-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.1rem, 2.6vw, 1.8rem);
}

.about-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 25px -5px rgb(0 0 0 / 0.1),
    0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Reveal animation */
.about-section .section-title,
.about-section .about-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}
.about-section.is-visible .section-title,
.about-section.is-visible .about-card {
  opacity: 1;
  transform: translateY(0);
}

/* Card types */
.card-image .card-inner { padding: 0; }
.card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-mission {
  font-size: clamp(.9rem, 1.6vw, 1.05rem);
  line-height: 1.55;
}
.mission-content { position: relative; }
.mission-content p { margin: 0; }
.mission-content::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1.2rem;
  height: 3px;
  width: 38%;
  border-radius: 4px;
  background: linear-gradient(to right, var(--accent), transparent);
}

/* Tagline */
.card-tagline .card-inner {
  align-items: center;
  text-align: center;
  color: #f8f9fa;
}
.card-tagline h3 {
  font-size: clamp(1.25rem, 2.8vw, 1.75rem);
  font-weight: 500;
  line-height: 1.45;
  margin: 0;
  position: relative;
  z-index: 2;
}
.card-tagline h3 .tag-hl {
  color: var(--qs-blue);
  font-weight: 600;
  text-shadow: 0 0 8px rgba(0,191,255,.35);
}
.card-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.card-bg-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(12,13,15,.62);
  z-index: 1;
}

/* Stats card */
.card-stats .card-inner {
  justify-content: flex-end;
  text-align: center;
  padding: 1.3rem;
}
.card-stats lottie-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .25;
  pointer-events: none;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  align-items: start;
  gap: .5rem .75rem;
  width: 100%;
  position: relative;
  z-index: 2;
}
.stat { text-align: center; }

.stat-top {
  font-weight: 700;
  color: var(--ink);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  line-height: 1;
  margin-bottom: 0.3rem;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: .15rem;
}
.stat-number,
.stat-prefix {
  display: inline;
  font: inherit;
  color: inherit;
}

.stat-label {
  font-size: clamp(.55rem, .85vw, .6rem);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  line-height: 1.2;
  max-width: 13.5ch;
  margin: 0 auto;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
}

/* Short screens */
@media (max-height: 820px) {
  .about-section { padding: clamp(1.8rem, 4.5vw, 3.2rem) 0; }
  .about-card::before { padding-top: 46%; }
}

/* ========================================
   MEDIUM SCREENS – small desktop & tablets
   641px – 1024px
   - Hide image card
   - Mission + Tagline side by side
   - Stats full width under
   - Remove rigid aspect ratio to avoid cropping
======================================== */
@media (min-width: 641px) and (max-width: 1024px) {

  .about-grid {
    grid-template-columns: minmax(0,1.1fr) minmax(0,1fr);
    grid-template-areas:
      "mission tagline"
      "stats   stats";
    align-items: stretch;
    gap: 1.1rem;
  }

  .about-grid .card-image {
    display: none;
  }

  .card-mission  { grid-area: mission; }
  .card-tagline  { grid-area: tagline; }
  .card-stats    { grid-area: stats; }

  /* Let cards size to content instead of fixed ratio */
  .about-card::before {
    padding-top: 0;
  }

  .about-card .card-inner {
    position: relative;
    min-height: 230px;
  }

  /* Slightly smaller tagline text on tighter widths */
  .card-tagline h3 {
    font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  }
}

/* ========================================
   MOBILE ≤ 640px – full stack
======================================== */
@media (max-width: 640px) {

  .about-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Hide image on phones */
  .about-grid .card-image {
    display: none;
  }

  /* Remove aspect ratio hack */
  .about-card::before {
    display: none;
  }

  .about-card {
    border-radius: 14px;
  }

  .about-card .card-inner {
    position: static;
    padding: 0.8rem 0.8rem;
  }

  /* Mission */
  .card-mission {
    font-size: 0.9rem;
    line-height: 1.5;
  }
  .mission-content::after {
    width: 44%;
    bottom: -.8rem;
  }

  /* Tagline */
  .card-tagline h3 {
    font-size: clamp(0.95rem, 4vw, 1.15rem);
    line-height: 1.4;
  }

  /* Stats – compact */
  .card-stats .card-inner {
    padding: 0.8rem 0.5rem;
  }

  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    align-items: center;
  }

  .stat-top {
    font-size: clamp(0.8rem, 3.6vw, 0.95rem);
    margin-bottom: 0.05rem;
  }

  .stat-label {
    font-size: clamp(0.95rem, 4.6vw, 1.15rem);
    max-width: 9ch;
    letter-spacing: 0.05em;
    line-height: 1.25;
    color: var(--ink);
    text-transform: none;
  }

  .stat:not(:last-child) {
    border-right: 1px solid rgba(0,0,0,0.08);
  }
}
