/* =========================================================
   ABOUT PAGE — FLIP CARDS (MOBILE-COMFY + CONSISTENT STYLING)
   - Titles match Circle/Goals (white + blue glow)
   - Quote uses lavender intro tone
   - Card text aligned to site (light on glass with soft glows)
   - Cards slightly more transparent to match site vibe
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Bubblegum+Sans&family=Open+Sans&display=swap");

/* ---------- RESET & BASE ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root{
  --header-h: 64px;
  --scroll-extra: 14px;

  /* Accent palette */
  --brand-purple: #dccdff;
  --brand-purple-deep: #7d5cf7;

  /* Sticky logo below header */
  --sticky-top: calc(var(--header-h) + 24px);

  /* Mobile logo guardrails */
  --mobile-logo-max-w: 68vw;
  --mobile-logo-max-h: 32vh;

  /* Layout widths */
  --mobile-content-max: 600px;

  /* Team card baseline (desktop) */
  --team-card-w: 420px;
  --team-card-h: 600px;
  --team-gap: 2.25rem;

  /* Flip animation */
  --flip-perspective: 1200px;
  --flip-duration: 560ms;
  --flip-ease: cubic-bezier(.2,.7,.2,1);

  /* Glass */
  --glass-bg: rgba(255,255,255,.22);
  --glass-border: rgba(255,255,255,.22);
  --glass-inset: rgba(255,255,255,.05);
  --glass-blur: 14px;
  --glass-sat: 110%;
  --glass-shadow: 0 10px 26px rgba(0,0,0,.22);
}

html{
  min-height:100%;
  overflow-y:scroll;
  overflow-x:hidden;
  scrollbar-gutter: stable;
  background:#0e1320;
  scroll-padding-top: calc(var(--header-h) + var(--scroll-extra));
}

body.about-page{
  min-height:100%;
  font-family:'Open Sans',sans-serif;
  color:#fff;
  line-height:1.65;
  background:#0e1320 url('images/Collages.jpg') center/cover fixed no-repeat;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Focus ring */
.nav-links a:focus-visible,
.cta-pill:focus-visible,
.flip-btn:focus-visible{
  outline:3px solid rgba(127,63,191,.6);
  outline-offset:3px;
}

/* ---------- HEADER ANIMATION ---------- */
body.about-page.force-anim header{
  transform:translate3d(0,-100%,0);
  animation:slideDownHeader .9s ease both 1 !important;
  will-change:transform;
}
@keyframes slideDownHeader{
  0%{transform:translate3d(0,-100%,0)}
  100%{transform:translate3d(0,0,0)}
}

/* Don’t animate the in-page Team header */
.team-section .team-header{
  position:static !important;
  inset:auto !important;
  z-index:auto !important;
  background:none !important;
  border:0 !important;
  padding:0 !important;
  transform:none !important;
  animation:none !important;
}

/* =========================================================
   MOBILE HEADER: SIDEWAYS SCROLL (PHONES ONLY)
   (Ensures About page nav matches global behavior on phones.)
   ========================================================= */
@media (max-width:768px){
  header{ padding:.6rem .9rem; }

  .nav-links{
    display:flex;
    justify-content:flex-start;
    gap:1rem;
    overflow-x:auto;
    overflow-y:hidden;
    white-space:nowrap;
    -webkit-overflow-scrolling:touch;
    scroll-behavior:smooth;
    touch-action:pan-x;
    padding-bottom:.2rem;
    scrollbar-width:none;               /* Firefox: hide bar */
    mask-image:linear-gradient(90deg, rgba(0,0,0,0) 0, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0) 100%);
  }
  .nav-links::-webkit-scrollbar{ display:none } /* WebKit: hide bar */
  .nav-links > li{ flex:0 0 auto; }
  .nav-links a{ display:inline-flex; align-items:center; padding:.25rem .1rem; }
}

/* =========================================================
   SECTION 1: HERO
   ========================================================= */
.hero{
  padding: calc(var(--header-h) + 56px) 2rem 6rem;
}
.hero-wrapper{
  width:min(1200px,92vw);
  margin-inline:auto;
  display:flex;
  flex-wrap:wrap;
  gap:3rem;
  align-items:flex-start;
}
.hero-left{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:1.2rem;
  min-width:280px;
  padding-left: clamp(12px, 2.5vw, 36px);
}
.hero-right{
  flex:1;
  display:flex;
  justify-content:center;
  align-items:flex-start;
}
.welcome-heading{
  font-family:'Bubblegum Sans',cursive;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height:1.1;
  text-shadow:0 5px 5px rgba(7,136,168,.95);
}
.subheading{
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight:600;
  color:#f1f5ff;
  text-shadow:0 3px 3px rgba(0,0,96,.8);
  max-width:48ch;
  line-height:1.7;
}
.cta-buttons{ display:flex; gap:1rem; margin-top:.25rem; flex-wrap:wrap; }

/* Sticky logo */
.about-page .hero-right.sticky-logo{ position: sticky; top: var(--sticky-top); align-self: flex-start; height: fit-content; }
.about-page .logo-cc-3{ position:relative !important; margin:0 !important; top:0 !important; left:0 !important; right:0 !important; }
.logo-image{ display:block; width: clamp(320px, 42vw, 500px); max-width:90%; height:auto; transition:transform .2s; }
.logo-image:hover{ transform:scale(1.03); }

/* =========================================================
   SECTION 2: TEAM — 3D FLIP CARDS
   ========================================================= */
.team-section{
  padding:6rem 2rem 3rem;
  display:flex;
  justify-content:center;
  background:rgba(255,255,255,.06) !important;
  scroll-margin-top: calc(var(--header-h) + var(--scroll-extra));
}
.team-wrapper{ width:min(1200px,92vw); margin:0 auto; }

.team-header{ text-align:center; margin-bottom:2rem; }

/* MATCH site’s section title look (white + blue glow like goals-heading) */
.team-heading{
  font-family:'Bubblegum Sans',cursive;
  font-size:clamp(2rem,4.6vw,3.6rem);
  color:#fff;
  text-shadow:0 5px 5px rgb(7,136,168);
}

/* More prominent, readable quote under team heading */
.team-quote {
  margin-top: .8rem;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  color: #f8f4ff;
  letter-spacing: 0.4px;
  text-shadow:
    0 3px 4px rgba(0, 213, 255, 0.301),
    0 3px 6px rgba(125,92,247,.65);
}

/* Two cards centered on desktop */
.team-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(320px, var(--team-card-w)));
  gap: var(--team-gap);
  width:auto;
  margin:0 auto;
  justify-content:center;
  justify-items:center;
  place-items:center;
}

/* Card container with perspective */
.team-card{
  width:100%;
  max-width: var(--team-card-w);
  height: var(--team-card-h);
  perspective: var(--flip-perspective);
  -webkit-perspective: var(--flip-perspective);
}

/* Flipping 3D object */
.card3d{
  position:relative;
  width:100%;
  height:100%;
  transform-style:preserve-3d;
  transition: transform var(--flip-duration) var(--flip-ease);
  will-change: transform;
}
.card3d.is-flipped{ transform: rotateY(180deg); }

/* Faces (more transparent glass) */
.card-face{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  padding:1.25rem 2.0rem 1.8rem 2.0rem;
  border-radius:16px;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;

  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow:
    var(--glass-shadow),
    inset 0 0 0 1px var(--glass-inset);
}
.card-face.front{ transform: rotateY(0deg); }
.card-face.back{ transform: rotateY(180deg); }

/* Front content */
.team-figure{ margin-bottom:.85rem; }
.team-photo{
  width:108px; height:108px; object-fit:cover;
  border-radius:50%; border:3px solid #fff;
  box-shadow:0 4px 10px rgba(0,0,0,.22);
}

/* ===== Consistent text styles (match site) ===== */
.team-name{
  font-weight:900;
  font-size:1.3rem;
  color:#fff;
  text-shadow:0 2px 3px rgb(13,29,112);
  margin-top:.35rem;
}
.team-role{
  font-style:italic;
  color:#ffddeec2;
  font-weight:700;
  letter-spacing:.2px;
  margin:.2rem 0 .7rem;
  text-shadow:0 2px 3px rgb(13,29,112);
}
.team-bio{
  font-size:1rem;
  color:#fff;
  line-height:1.65;
  text-shadow:0 3px 3px rgb(13,29,112);
  overflow-wrap:anywhere;
}

/* Flip controls — ghost style */
.flip-btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.65);
  background: rgba(255,255,255,.14);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px; height:34px; border-radius:9999px;
  position:absolute; top:50%; transform: translateY(-50%);
  right:6px;
  box-shadow:0 6px 14px rgba(0,0,0,.16);
  transition:transform .15s ease, filter .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.flip-btn:hover{
  transform: translateY(-50%) scale(1.06);
  filter: brightness(1.06);
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.9);
}
.flip-btn i, .flip-btn svg{ width:20px; height:20px; stroke:#fff }

/* Back: place button on LEFT by default */
.card-face.back .flip-btn.back-btn{ left:6px; right:auto; }

/* Opposite sides for FIRST card (Dalia) */
.team-grid > .team-card:first-child .card-face.front .flip-btn{
  left:6px !important; right:auto !important;
}
.team-grid > .team-card:first-child .card-face.front .flip-btn i,
.team-grid > .team-card:first-child .card-face.front .flip-btn svg{
  transform: rotate(180deg);
  transform-origin:center;
}
.team-grid > .team-card:first-child .card-face.back .flip-btn.back-btn{
  right:6px !important; left:auto !important;
}

/* Back face: certificates */
.certs-grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:.6rem;
  width:100%; height:100%; align-content:start;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
  border-radius:12px;
  padding:.7rem;
  overflow:auto;
}
.certs-grid img{
  width:100%; aspect-ratio:4/3; object-fit:contain;
  background:#fff; border:2px solid #fff; border-radius:10px;
  box-shadow:0 4px 10px rgba(0,0,0,.18);
}

/* =========================================================
   SECTION 3: OUR STORY
   ========================================================= */
#our-story{
  padding: 4.5rem 2rem 6rem;
  display:flex; justify-content:center;
  scroll-margin-top: calc(var(--header-h) + var(--scroll-extra));
}
.story-wrapper{ width:min(1000px,92vw); text-align:center; }
.goals-heading{
  font-family:'Bubblegum Sans',cursive;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  text-shadow: 0 4px 5px rgba(7,136,168,.9);
  color:#fff;
}
.goals-intro{
  margin:1rem auto 2rem;
  max-width:78ch;
  color:#e6e6fa;
  font-weight:700;
  font-size: clamp(1.08rem, 2.0vw, 1.3rem);
  line-height:1.72;
  text-shadow:0 3px 3px rgb(0,0,96);
}
.story-bubble{
  display:flow-root; position:relative; margin:0 auto;
  padding:2rem 2.25rem; max-width:90ch; text-align:left;
  background:rgba(255,255,255,.26);
  border:1px solid rgba(255,255,255,.28);
  border-radius:18px;
  backdrop-filter:blur(12px) saturate(105%);
  -webkit-backdrop-filter:blur(12px) saturate(105%);
  box-shadow:0 18px 40px rgba(0,0,0,.28);
  color:#ebf1ff;
  font-size: clamp(1.02rem, 1.75vw, 1.12rem);
  line-height:1.9;
}
.story-bubble p{ margin:0 0 1.2rem; text-shadow:0 4px 10px rgb(99,0,157); }
.float-image{
  float:right; width:clamp(220px,33%,320px); height:auto;
  margin:.25rem 0 .85rem 1.5rem;
  border-radius:14px; background:rgba(255,255,255,.9);
  border:2px solid rgba(255,255,255,.95);
  box-shadow:0 16px 28px rgba(0,0,0,.25);
  shape-outside: inset(0 round 14px); shape-margin:6px;
}

/* ---------- Separator ---------- */
.section-separator{
  height:32px;
  background:linear-gradient(to bottom, rgba(255,255,255,.06) 0%, rgba(255,255,255,.10) 100%);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1368px){
  .team-grid{ gap:2rem; }
  :root{ --team-card-h: 580px; }
}

@media (max-width: 1024px){
  .team-grid{
    grid-template-columns: 1fr;
  }
  .team-card{
    max-width: min(var(--mobile-content-max), 92vw);
    height: 680px;
  }
  .team-photo{ width:100px; height:100px; }
  .team-bio{ font-size: .98rem; line-height:1.6; }
  .card-face{ padding:1.1rem 1.6rem 1.5rem; }
  .certs-grid{ gap:.5rem; }
}

@media (max-width: 900px){
  .hero{
    padding: calc(var(--header-h) + 40px) 1.25rem 3.5rem;
    text-align:center;
  }
  .hero-wrapper{
    width:min(var(--mobile-content-max),94vw);
    gap:1.5rem;
    flex-direction:column;
    align-items:center;
  }
  .hero-left{ padding-left:0; align-items:center; max-width:min(52ch, var(--mobile-content-max)); }

  .about-page .hero-right.sticky-logo{ position:static !important; top:auto !important; align-self:center !important; }
  .logo-image{
    max-width:min(var(--mobile-logo-max-w), 360px) !important;
    max-height:var(--mobile-logo-max-h) !important;
    width:auto !important; height:auto !important;
    margin:.25rem auto 0 !important; position:relative !important; object-fit:contain;
  }

  .team-section{ background:rgba(255,255,255,.06) !important; padding:3.5rem 1.1rem 2.25rem; }

  .team-card{ height: 600px; }
  .team-photo{ width:92px; height:92px; }
  .team-name{ font-size:1.22rem; }
  .team-role{ font-size:1rem; }
  .team-bio{ font-size:.96rem; line-height:1.62; }
  .card-face{ padding:1rem 1.35rem 1.25rem; }
  .flip-btn{ width:32px; height:32px; }

  #our-story{ padding:3rem 1.1rem 4rem; }
  .story-wrapper{ width:min(var(--mobile-content-max),94vw); }
  .story-bubble{ max-width:var(--mobile-content-max); padding:1.5rem 1.4rem; }
  .float-image{ float:none; display:block; margin:0 auto 1rem; width:min(80%,340px); }
}

@media (max-width: 600px){
  .welcome-heading{ font-size:2.2rem; }
  .subheading{ font-size:1.02rem; line-height:1.65; }
  .team-heading{ font-size:2rem; }
  .team-card{ height: 560px; }
  .certs-grid{ grid-template-columns:1fr 1fr; gap:.45rem; }
  .team-bio{ font-size:.94rem; line-height:1.55; }
}

@media (max-width: 380px){
  :root{ --mobile-logo-max-w:62vw; --mobile-logo-max-h:28vh; }
  .team-card{ border-radius:14px; height: 560px; }
  .team-bio{ font-size:.92rem; }
}

/* =========================================================
   PLATFORM GUARDS & PERFORMANCE
   ========================================================= */
@supports (-webkit-touch-callout:none){
  body.about-page{ background-attachment:scroll !important; }
  body.about-page::before{
    content:""; position:fixed; inset:0; z-index:-1;
    background:#0e1320 url('images/Collages.jpg') center/cover no-repeat;
  }
}
.hero, .team-section, #our-story, .section-separator{
  content-visibility:auto;
  contain-intrinsic-size:1000px;
}
@media (prefers-reduced-motion: reduce){
  *{ animation:none !important; transition:none !important; scroll-behavior:auto !important; }
  body.about-page.force-anim header{ transform:none !important; }
}

/* ===== ABOUT FOOTER (non-destructive) ===== */
.main-footer .footer-inner{
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.main-footer .footer-policy-link{
  position: absolute;
  right: clamp(12px, 2vw, 24px);
  color: inherit;
  text-decoration: none;
}
.main-footer .footer-policy-link:hover,
.main-footer .footer-policy-link:focus{
  text-decoration: underline;
}
