/* =========================================================
   SMALL SCREENS: make the space work harder
   Loaded last on every page. Paragraphs of reading text stay
   full width; buttons, numbers, cards, videos, lists and the
   footer sit in two columns or a swipeable row instead of one
   element per row.
   ========================================================= */

/* ---------- Swipeable card rows (phones) ----------
   Cards sit side by side; the next card peeks in so people
   know to swipe. Applied to existing grids by selector. */
@media (max-width: 600px) {
  .h-roles,
  .sp-talks__grid,
  .rt-two,
  .rt-research__side {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 80%;
    gap: 0.875rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter, 16px);
    margin-inline: calc(-1 * var(--gutter, 16px));
    padding: 0.25rem var(--gutter, 16px) 1rem;
    border-top: 0;
    scrollbar-width: thin;
    scrollbar-color: #D97706 transparent;
    align-items: stretch;
  }
  .h-roles::-webkit-scrollbar,
  .sp-talks__grid::-webkit-scrollbar,
  .rt-two::-webkit-scrollbar,
  .rt-research__side::-webkit-scrollbar { height: 3px; }
  .h-roles::-webkit-scrollbar-thumb,
  .sp-talks__grid::-webkit-scrollbar-thumb,
  .rt-two::-webkit-scrollbar-thumb,
  .rt-research__side::-webkit-scrollbar-thumb { background: #D97706; border-radius: 3px; }

  .h-roles > *,
  .sp-talks__grid > *,
  .rt-two > *,
  .rt-research__side > * { scroll-snap-align: start; min-width: 0; }

  /* the role and talk columns become cards */
  .h-role,
  .sp-talk {
    background: #fff;
    border: 1px solid var(--hair) !important;
    border-radius: 10px;
    padding: 1.25rem 1.1rem !important;
    box-shadow: 0 16px 32px -26px rgba(61, 26, 43, 0.5);
  }
  .h-role + .h-role,
  .sp-talk + .sp-talk { border-top: 1px solid var(--hair); }
  .rt-card { padding: 1.25rem 1.1rem; }
}

/* ---------- Hero buttons: two side by side ---------- */
@media (max-width: 860px) {
  .h-hero__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
  }
  .h-hero__actions .h-btn {
    width: auto;
    min-width: 0;
    flex: none;
    padding: 0.85rem 0.5rem;
    font-size: 0.71875rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
    justify-content: center;
  }
}
@media (max-width: 600px) {
  /* a little smaller hero photo leaves room for the words */
  .h-hero__media { max-width: 290px; }
  .sp-hero .h-hero__media { max-width: 100%; }
}

/* ---------- Closing call to action: two buttons in a row ---------- */
@media (max-width: 600px) {
  .h-cta__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
  }
  .h-cta__actions .h-btn {
    width: auto;
    min-width: 0;
    padding: 0.85rem 0.5rem;
    font-size: 0.71875rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
    justify-content: center;
  }
  .h-cta__or { display: none; }
  .h-cta__title { font-size: 1.75rem; }

  /* older pages */
  .cta-section__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
  .cta-section__actions .btn { width: auto; margin: 0; padding: 0.85rem 0.5rem; font-size: 0.75rem; white-space: nowrap; justify-content: center; }
  .cta-section__divider { display: none; }
  .cta-section .btn { margin: 0; }

  /* social row: label and icons on one line */
  .cta-social { flex-direction: row; gap: 0.75rem; }
  .cta-social__label { font-size: 0.6875rem; letter-spacing: 0.16em; }
  .cta-social__links { gap: 0.5rem; }
  .cta-social__link { width: 40px; height: 40px; }
  .cta-social__link svg { width: 18px; height: 18px; }
}

/* ---------- Numbers: side by side ---------- */
@media (max-width: 860px) {
  .h-stats__grid { grid-template-columns: repeat(3, 1fr); }
  .h-stat { padding: 0.75rem 0.4rem; }
  .h-stat + .h-stat { border-top: 0; border-left: 1px solid rgba(255, 255, 255, 0.16); }
  .h-stat__number { font-size: clamp(1.625rem, 7.5vw, 2.25rem); }
  .h-stat__label { font-size: 0.75rem; line-height: 1.45; }
  .im-stats .h-stats__grid { grid-template-columns: repeat(2, 1fr); row-gap: 1.25rem; }
  .im-stats .h-stat:nth-child(odd) { border-left: 0; }
  .stats { grid-template-columns: repeat(3, 1fr) !important; gap: 0.75rem; }
}

/* ---------- Videos: two per row ---------- */
@media (max-width: 860px) {
  .sp-videos,
  .im-videos { grid-template-columns: repeat(2, 1fr); gap: 1rem 0.75rem; }
  .sp-videos .sp-video:last-child { grid-column: auto; }
  .sp-video__play { width: 46px; height: 46px; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.25); }
  .sp-video__play::after { border-width: 8px 0 8px 13px; }
  .sp-video figcaption { padding-top: 0.6rem; }
  .sp-video__title { font-size: 0.9375rem; line-height: 1.3; }
  .sp-video__meta { font-size: 0.625rem; letter-spacing: 0.1em; }
  .sp-video__yt { font-size: 0.75rem; }
  .video-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.75rem; }
}

/* ---------- About blocks: smaller photo beside nothing, centred ---------- */
@media (max-width: 600px) {
  .sp-about { gap: 1.75rem; }
  .sp-about__media { max-width: 260px; }
  .sp-about__text .sp-about__lead { font-size: 1.1875rem; }
}

/* ---------- Lists and tags ---------- */
@media (max-width: 600px) {
  .im-tracks li,
  .rt-tags li { font-size: 0.8125rem; padding: 0.35rem 0.75rem; }
  .rt-pub { grid-template-columns: 3rem 1fr; gap: 0.75rem; padding: 1.1rem 0; }
  .rt-pub__year { font-size: 1rem; }
  .rt-pub__title { font-size: 1rem; }
  .rt-pub__authors { font-size: 0.8125rem; }
  .rt-pub__venue { font-size: 0.75rem; }
  .rt-highlight { font-size: 1.0625rem; }
}

/* ---------- Partner / trusted logos ---------- */
@media (max-width: 600px) {
  .h-marquee__item img { max-height: 40px; }
}

/* ---------- Older pages: grids keep two columns on phones ---------- */
@media (max-width: 768px) {
  .grid-3, .roles { grid-template-columns: repeat(2, 1fr) !important; gap: 0.875rem; }
  .gallery { grid-template-columns: repeat(2, 1fr) !important; }
  .hero__actions { flex-direction: row !important; flex-wrap: nowrap; gap: 0.625rem; }
  .hero__actions .btn { flex: 1 1 0; padding: 0.85rem 0.5rem; font-size: 0.75rem; white-space: nowrap; justify-content: center; }
  .form__row { grid-template-columns: 1fr 1fr !important; gap: 0.75rem; }
}
@media (max-width: 380px) {
  .form__row { grid-template-columns: 1fr !important; }
}

/* ---------- Footer: two columns ---------- */
@media (max-width: 768px) {
  .footer { padding-top: 2.75rem; }
  .footer__grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 1.75rem 1.25rem !important;
  }
  .footer__brand p { display: none; }               /* the same line opens the homepage */
  .footer__logo { width: 72px; height: auto; margin-bottom: 0.75rem; }
  .footer__social { flex-wrap: wrap; gap: 0.5rem; }
  .footer__social a { width: 36px; height: 36px; }
  .footer__heading { margin-bottom: 0.75rem; }
  .footer__links { gap: 0.55rem; }
  .footer__links a { font-size: 0.875rem; overflow-wrap: anywhere; }
  .footer__bottom {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1rem !important;
    text-align: left !important;
    font-size: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
  }
}

/* Footer order on small screens: logo + socials | Explore, then Get in touch | Quick links */
@media (max-width: 768px) {
  .footer__brand { grid-column: auto !important; order: 1; }
  .footer__grid > :nth-child(2) { order: 2; }   /* Explore */
  .footer__grid > :nth-child(4) { order: 3; }   /* Get in touch */
  .footer__grid > :nth-child(3) { order: 4; }   /* Quick links */
  .footer__links a[href^="mailto:"] { font-size: 0.8125rem; }
}

/* Long button labels may take two lines rather than crowd the edges */
@media (max-width: 860px) {
  .h-hero__actions .h-btn,
  .h-cta__actions .h-btn,
  .cta-section__actions .btn,
  .hero__actions .btn {
    white-space: normal;
    line-height: 1.25;
    text-align: center;
    min-height: 48px;
  }
}

/* ---------- Older pages: forms and photos ---------- */
@media (max-width: 768px) {
  /* radio choices side by side (Yes | No, Online | In-Person | Hybrid) */
  .form__radio-group {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.5rem;
  }
  .form__radio-label { justify-content: center; padding-inline: 0.5rem; font-size: 0.875rem; }
  /* submit buttons size to their label */
  .form [type="submit"] { width: auto !important; padding-inline: 1.75rem; }
  /* story photos: a framed, smaller picture rather than a full-width block */
  .story__image { max-width: 300px; margin-inline: auto; }
  .story__image img { max-height: 320px; }
}

/* =========================================================
   MOBILE MENU: compact, scrollable, sized to the screen
   - phones: full-screen panel, links in two columns
   - tablets / small laptops: a side drawer over a dimmed page
   - always scrolls when the screen is short
   ========================================================= */
.nav__mobile {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(var(--nav-height, 70px) + 0.75rem) var(--gutter, 16px) 1.5rem;
  gap: 0;
  visibility: hidden;
  transition: right 0.45s cubic-bezier(.65,0,.35,1), visibility 0s linear 0.45s, box-shadow 0.45s ease;
}
.nav__mobile--open {
  visibility: visible;
  transition: right 0.45s cubic-bezier(.65,0,.35,1), visibility 0s, box-shadow 0.45s ease;
}
.nav__mobile-link {
  font-size: clamp(1.0625rem, 3.6vw, 1.3125rem);
  line-height: 1.3;
  padding: 0.8rem 0.25rem;
  position: relative;
}
.nav__mobile-link[aria-current="page"],
.nav__mobile-link.nav__mobile-link--active { color: #5E2A41; }
.nav__mobile-link[aria-current="page"]::before,
.nav__mobile-link.nav__mobile-link--active::before {
  content: "";
  position: absolute;
  left: -0.6rem; top: 50%;
  width: 3px; height: 1.1em;
  transform: translateY(-50%);
  border-radius: 2px;
  background: #D97706;
}
.nav__mobile-cta {
  align-self: flex-start;
  width: auto;
  margin-top: 1.5rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.8125rem;
}
.nav__mobile-social {
  margin-top: 1.25rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.nav__mobile-social a {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(94, 42, 65, 0.2);
  color: #5E2A41;
  transition: background 0.3s ease, color 0.3s ease;
}
.nav__mobile-social a:hover { background: #5E2A41; color: #FCF8F5; }
.nav__mobile-social svg { width: 18px; height: 18px; }

/* Phones: links in two columns, so the whole menu fits without scrolling */
@media (max-width: 599px) {
  .nav__mobile {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    align-content: start;
    column-gap: 1.25rem;
  }
  .nav__mobile-link { font-size: 1.0625rem; padding: 0.85rem 0.25rem; }
  .nav__mobile-cta { grid-column: 1; justify-self: start; white-space: nowrap; }
  .nav__mobile-social { grid-column: 2; align-self: center; justify-self: end; margin-top: 1.5rem; }
}
@media (max-width: 359px) {
  .nav__mobile-cta { grid-column: 1 / -1; }
  .nav__mobile-social { grid-column: 1 / -1; justify-self: start; margin-top: 0.75rem; }
}

/* Tablets and small laptops: a drawer from the right, page dimmed behind it */
@media (min-width: 600px) {
  .nav__mobile {
    width: min(400px, 82vw);
    right: calc(-1 * min(400px, 82vw) - 40px);
    border-left: 1px solid rgba(94, 42, 65, 0.12);
    padding-inline: 2rem;
  }
  .nav__mobile--open {
    right: 0;
    box-shadow: 0 0 0 100vmax rgba(28, 17, 24, 0.45), -24px 0 48px -24px rgba(28, 17, 24, 0.5);
  }
}

/* Short screens (landscape phones): tighter rows */
@media (max-height: 520px) {
  .nav__mobile-link { padding: 0.55rem 0.25rem; font-size: 1rem; }
  .nav__mobile-cta { margin-top: 1rem; }
}

/* =========================================================
   "About me as …" blocks: when the layout stacks, the title
   comes first, then the photo, then the words
   ========================================================= */
@media (max-width: 860px) {
  .sp-about { row-gap: 0; }
  .sp-about__text { display: contents; }
  .sp-about__head { order: 1; margin: 0 auto 1.5rem; }
  .sp-about__media { order: 2; margin-bottom: 1.75rem; }
  .sp-about__text > :not(.sp-about__head) { order: 3; }
}
/* menu refinements: logo stays visible above the open menu; socials get their own row on phones */
.nav__logo { position: relative; z-index: 1001; }
@media (max-width: 599px) {
  .nav__mobile-cta { grid-column: 1 / -1; }
  .nav__mobile-social { grid-column: 1 / -1; justify-self: start; margin-top: 1rem; }
}
@media (max-width: 860px) {
  .sp-about__text > .h-textlink { justify-self: start; width: auto; max-width: max-content; }
}

/* =========================================================
   SWIPE ROW CONTROLS (built by main.js; phones only)
   ‹  ● ━ ●   1 / 3 · swipe for more  ›
   ========================================================= */
.swipe-nav { display: none; }
@media (max-width: 600px) {
  .swipe-nav:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.5rem;
  }
  .swipe-nav__btn {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1px solid #5E2A41;
    background: #5E2A41;
    color: #FCF8F5;
    cursor: pointer;
    transition: opacity 0.3s ease, background 0.3s ease, transform 0.2s ease;
  }
  .swipe-nav__btn:active { transform: scale(0.94); }
  .swipe-nav__btn:disabled { background: transparent; color: #5E2A41; opacity: 0.35; cursor: default; }
  .swipe-nav__middle { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; min-width: 0; }
  .swipe-nav__dots { display: flex; gap: 0.4rem; }
  .swipe-nav__dot {
    width: 8px; height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(94, 42, 65, 0.25);
    cursor: pointer;
    transition: width 0.3s ease, background 0.3s ease;
  }
  .swipe-nav__dot.is-active { width: 24px; background: #D97706; }
  .swipe-nav__hint {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #8A5A6E;
    white-space: nowrap;
  }
  .swipe-nav__count { color: #5E2A41; font-weight: 700; }

  /* the one-time nudge: cards slide left a little and back */
  .swipe-nudge > * { animation: swipeNudge 1.1s cubic-bezier(.45,0,.25,1) 0.2s 1; }
  @keyframes swipeNudge {
    0%, 100% { transform: translateX(0); }
    40% { transform: translateX(-38px); }
    70% { transform: translateX(6px); }
  }
}
@media (prefers-reduced-motion: reduce) { .swipe-nudge > * { animation: none; } }

/* Phone menu: one column (compact rows, everything fits and scrolls if needed) */
@media (max-width: 599px) {
  .nav__mobile {
    display: flex !important;
    flex-direction: column;
    gap: 0;
  }
  .nav__mobile-link { font-size: 1.125rem; padding: 0.75rem 0.25rem; }
  .nav__mobile-cta { align-self: flex-start; margin-top: 1.25rem; }
  .nav__mobile-social { align-self: flex-start; margin-top: 1rem; }
}
@media (max-width: 599px) and (max-height: 640px) {
  .nav__mobile-link { font-size: 1.0625rem; padding: 0.6rem 0.25rem; }
  .nav__mobile-cta { margin-top: 1rem; }
}

/* Trusted By / Our Partners on phones: smaller logos, tighter spacing,
   so four or five logos show at once */
@media (max-width: 600px) {
  .h-marquee__group { gap: 1.5rem; padding-right: 1.5rem; }
  .h-marquee__item img,
  .im-hero ~ .sp-trusted .h-marquee__item img { height: 28px; max-height: 28px; max-width: 92px; }
  .h-marquee__item img[src*="digit_logo"] { height: 38px; max-height: 38px; }
  .h-marquee__item img[src*="uni-ibadan"],
  .h-marquee__item img[src*="uni-lagos"] { height: 34px; max-height: 34px; }   /* square crests read better a touch taller */
  .h-marquee__track { animation-duration: 26s; }
  .h-marquee { -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
                       mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); }
}

/* =========================================================
   FOOTER: tighter spacing on every screen size
   ========================================================= */
.footer { padding: clamp(2rem, 4vw, 3rem) 0 1.25rem !important; }
.footer__grid {
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 3rem) !important;
  margin-bottom: clamp(1.5rem, 3vw, 2rem) !important;
  align-items: start;
}
.footer__brand p { margin-top: 0.75rem; }
.footer__social { margin-top: 1rem; }
.footer__heading { margin-bottom: 0.75rem !important; }
.footer__links { gap: 0.5rem; }
.footer__bottom { padding-top: 1rem !important; margin-top: 0 !important; }
@media (max-width: 768px) {
  .footer { padding-top: 1.75rem !important; }
  .footer__grid { gap: 1.25rem 1.25rem !important; margin-bottom: 1.25rem !important; }
  .footer__logo { width: 64px; margin-bottom: 0.5rem; }
  .footer__social { margin-top: 0.5rem; }
}
/* tablets / small laptops: keep the four footer columns in one row */
@media (min-width: 769px) and (max-width: 1024px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1.1fr !important; }
  .footer__brand { grid-column: auto !important; }
  .footer__brand p { font-size: 0.875rem; }
  .footer__links a[href^="mailto:"] { font-size: 0.875rem; }
}

/* long "About …" titles wrap instead of widening the page */
.sp-about__head { max-width: 100%; }
@media (max-width: 860px) {
  .sp-about__head { width: auto; }
  .sp-about__head .h-eyebrow { white-space: normal; text-align: center; line-height: 1.7; }
}

/* Footer "Get in Touch": addresses shown as plain text (not mailto links, so bots can't harvest them) */
.footer__contact p { margin: 0; padding: 0.25rem 0; color: rgba(255,255,255,0.8); font-size: 0.9375rem; line-height: 1.5; overflow-wrap: anywhere; }
.footer__contact-label { display: block; color: rgba(255,255,255,0.6); font-size: 0.8125rem; }
@media (max-width: 768px) { .footer__contact p { font-size: 0.8125rem; } }
/* plain-text addresses: one tap/click selects the whole address for copying */
.footer__email, .ct__value--plain, .rt-email { -webkit-user-select: all; user-select: all; cursor: text; }
.footer__email { overflow-wrap: normal; word-break: normal; }

/* =========================================================
   PHONES: no single photo or card takes over the screen
   ========================================================= */
@media (max-width: 600px) {
  /* photos that sit beside a block of text (About, Founder, Research, Why me…) */
  .sp-about__media { max-width: 210px !important; }
  .ab-story__media { max-width: 220px !important; }
  /* a lone video card (e.g. the video testimonial) stays a comfortable size */
  .sp-words__video { max-width: 280px !important; }
}
@media (max-width: 380px) {
  .sp-about__media, .ab-story__media { max-width: 190px !important; }
  /* long button labels may wrap rather than push the page sideways */
  .cc-hero .h-btn, .h-hero .h-btn { white-space: normal !important; text-align: center; }
}
@media (max-width: 380px) {
  .h-btn { white-space: normal !important; max-width: 100%; text-align: center; }
}

/* =========================================================
   PHONES & TABLETS: buttons sized to their label, never the
   full screen. A hero's buttons and its small text link sit
   together in one centred row (wrapping only if they can't fit).
   ========================================================= */
@media (max-width: 860px) {
  .h-hero .h-hero__cta {
    display: flex !important;
    order: 5;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem 1.25rem;
    width: 100%;
    margin-top: 0.5rem;
  }
  .h-hero .h-hero__actions {
    position: static;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.625rem;
    width: auto;
    margin: 0;
    padding: 0;
    background: none;
    align-self: center;
  }
  .h-hero .h-hero__actions .h-btn {
    flex: 0 1 auto;
    width: auto;
    padding: 0.8rem 1.15rem;
    font-size: 0.71875rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
    min-height: 44px;
  }
  .h-hero .h-hero__cta .h-textlink { order: 2; margin: 0; align-self: center; white-space: nowrap; }

  /* closing "Ready to…" and other section buttons: natural width, centred */
  .h-cta__actions { justify-content: center; }
  .h-cta__actions .h-btn,
  .sp-center .h-btn,
  .cc-details__cta .h-btn { width: auto !important; max-width: 100%; }
}
@media (max-width: 380px) {
  .h-hero .h-hero__actions .h-btn { padding: 0.75rem 0.8rem; font-size: 0.65625rem; letter-spacing: 0.05em; }
}
@media (max-width: 860px) {
  .h-hero .h-hero__cta .h-hero__actions { order: 1; }
  .h-hero .h-hero__cta .h-textlink { order: 2; }
}

/* Swipeable card rows: no scrollbars at all (the arrows, dots and swipe are enough) */
.h-roles, .sp-talks__grid, .rt-two, .rt-research__side, .ia-quotes, .sp-subnav__inner {
  scrollbar-width: none !important;
  -ms-overflow-style: none;
}
.h-roles::-webkit-scrollbar, .sp-talks__grid::-webkit-scrollbar, .rt-two::-webkit-scrollbar,
.rt-research__side::-webkit-scrollbar, .ia-quotes::-webkit-scrollbar, .sp-subnav__inner::-webkit-scrollbar {
  display: none !important; width: 0 !important; height: 0 !important;
}
@media (max-width: 600px) {
  .h-roles, .sp-talks__grid, .rt-two, .rt-research__side { overflow-y: hidden; }
}
