/**
 * Motion & layout layer — Muhizi brand colors; typography: Roboto + Roboto Slab.
 */

@import url("https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@600;700;800&family=Roboto:wght@400;500;600;700&display=swap");

:root {
  --md-font-display: "Roboto Slab", serif;
  --md-font-body: "Roboto", sans-serif;
  /* Align with css/style.css --color-blue-* */
  --md-black: #000;
  --md-charcoal: #000;
  --md-accent: var(--color-blue-600);
  --md-accent-bright: var(--color-blue-400);
  --md-white: #fff;
  --md-muted: rgba(255, 255, 255, 0.78);
  --md-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --md-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --md-reveal-duration: 0.9s;
  --md-reveal-shift: 48px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--md-font-body), system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ——— Scroll reveals ——— */
.reveal {
  opacity: 0;
  transform: translate3d(0, var(--md-reveal-shift), 0);
  filter: blur(6px);
  transition:
    opacity var(--md-reveal-duration) var(--md-ease-out),
    transform var(--md-reveal-duration) var(--md-ease-out),
    filter var(--md-reveal-duration) var(--md-ease-out);
  will-change: opacity, transform, filter;
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
}

.reveal-left {
  transform: translate3d(calc(var(--md-reveal-shift) * -1), 0, 0);
}

.reveal-left.is-visible {
  transform: translate3d(0, 0, 0);
}

.reveal-right {
  transform: translate3d(var(--md-reveal-shift), 0, 0);
}

.reveal-right.is-visible {
  transform: translate3d(0, 0, 0);
}

.reveal-scale {
  transform: scale(0.94);
  filter: blur(4px);
}

.reveal-scale.is-visible {
  transform: scale(1);
  filter: blur(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 0.75s var(--md-ease-out),
    transform 0.75s var(--md-ease-out);
}

.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.reveal-stagger.is-visible > *:nth-child(1) {
  transition-delay: 0.05s;
}
.reveal-stagger.is-visible > *:nth-child(2) {
  transition-delay: 0.12s;
}
.reveal-stagger.is-visible > *:nth-child(3) {
  transition-delay: 0.19s;
}
.reveal-stagger.is-visible > *:nth-child(4) {
  transition-delay: 0.26s;
}
.reveal-stagger.is-visible > *:nth-child(5) {
  transition-delay: 0.33s;
}
.reveal-stagger.is-visible > *:nth-child(6) {
  transition-delay: 0.4s;
}
.reveal-stagger.is-visible > *:nth-child(7) {
  transition-delay: 0.47s;
}
.reveal-stagger.is-visible > *:nth-child(8) {
  transition-delay: 0.54s;
}

.reveal-rise-slow {
  opacity: 0;
  transform: translate3d(0, calc(var(--md-reveal-shift) * 1.4), 0);
  filter: blur(8px);
  transition:
    opacity 1.12s var(--md-ease-out),
    transform 1.12s var(--md-ease-out),
    filter 1.12s var(--md-ease-out);
  will-change: opacity, transform, filter;
}

.reveal-rise-slow.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
}

.reveal-tilt {
  opacity: 0;
  transform: perspective(920px) translate3d(0, 40px, 0) rotateX(8deg);
  filter: blur(5px);
  transition:
    opacity 1s var(--md-ease-out),
    transform 1s var(--md-ease-out),
    filter 1s var(--md-ease-out);
  will-change: opacity, transform, filter;
}

.reveal-tilt.is-visible {
  opacity: 1;
  transform: perspective(920px) translate3d(0, 0, 0) rotateX(0);
  filter: blur(0);
}

/* ——— Header: glass on scroll ——— */
.header_section {
  transition:
    background 0.45s var(--md-ease-out),
    box-shadow 0.45s var(--md-ease-out),
    backdrop-filter 0.45s var(--md-ease-out);
}

.header_section.md-header-scrolled {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 68, 148, 0.9) 45%,
    rgba(14, 29, 66, 0.88) 100%
  ) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.custom_nav-container .navbar-nav .nav-item .nav-link {
  position: relative;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-size: 13px;
}

.custom_nav-container .navbar-nav .nav-item .nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--md-accent-bright), var(--md-accent));
  transform: translateX(-50%);
  transition: width 0.35s var(--md-ease-out);
}

.custom_nav-container .navbar-nav .nav-item:hover .nav-link::after,
.custom_nav-container .navbar-nav .nav-item.active .nav-link::after {
  width: 70%;
}

.navbar-brand {
  font-family: var(--md-font-display);
  letter-spacing: -0.02em;
}

.navbar-brand span {
  background: linear-gradient(120deg, var(--md-accent-bright), var(--md-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
}

/* ——— Hero / carousel ——— */
#carousel {
  position: relative;
  overflow: hidden;
}

#carousel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 86, 179, 0.42) 50%,
    rgba(14, 29, 66, 0.2) 100%
  );
}

#carousel .carousel-inner {
  position: relative;
  z-index: 0;
}

.carousel-item {
  position: relative;
}

.carousel-item .carousel-img {
  transform: scale(1.08);
  transition: transform 1.2s var(--md-ease-out);
}

.carousel-item.active .carousel-img {
  animation: mdKenBurns 14s var(--md-ease-out) forwards;
}

@keyframes mdKenBurns {
  0% {
    transform: scale(1.12) translate3d(-1%, 0, 0);
  }
  100% {
    transform: scale(1) translate3d(0, 0, 0);
  }
}

.carousel-caption {
  z-index: 2;
  left: 8%;
  right: auto;
  bottom: 18%;
  max-width: min(640px, 92vw);
  text-align: left;
  padding: 0;
}

.md-hero-eyebrow {
  font-family: var(--md-font-body);
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--md-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.md-hero-kicker {
  font-family: var(--md-font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--md-accent-bright);
  margin-bottom: 0.6rem;
}

.md-hero-lede {
  font-family: var(--md-font-body);
  font-size: clamp(0.88rem, 1.85vw, 1.05rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  max-width: 42ch;
  margin-bottom: 0.85rem;
}

.md-hero-title,
.outline-text {
  font-family: var(--md-font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: #fff !important;
  -webkit-text-stroke: 0;
  text-stroke: 0;
  text-shadow:
    0 4px 32px rgba(0, 0, 0, 0.5),
    0 0 1px rgba(255, 255, 255, 0.15);
  background: linear-gradient(180deg, #fff 28%, rgba(200, 230, 255, 0.95) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  font-size: clamp(2.25rem, 6vw, 4.5rem) !important;
  margin: 0 0 1.25rem;
}

.outline-text1 {
  font-family: var(--md-font-body);
  font-weight: 600;
  -webkit-text-stroke: 0;
  text-stroke: 0;
  color: rgba(255, 255, 255, 0.92) !important;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.45);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem) !important;
  letter-spacing: 0.02em;
  line-height: 1.55;
  max-width: 36ch;
}

.md-cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--md-font-body);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--md-black) !important;
  background: linear-gradient(135deg, #fff 0%, #e8f4ff 100%);
  border-radius: 999px;
  border: none;
  box-shadow:
    0 4px 24px rgba(14, 29, 66, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  transition:
    transform 0.35s var(--md-ease-spring),
    box-shadow 0.35s var(--md-ease-out);
}

.md-cta-pill:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 12px 40px rgba(14, 29, 66, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.35);
  color: var(--md-black) !important;
  text-decoration: none;
}

.carousel-control-prev,
.carousel-control-next {
  z-index: 3;
  width: 52px;
  height: 52px;
  top: auto;
  bottom: 2rem;
  opacity: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(8px);
  transition:
    background 0.3s var(--md-ease-out),
    transform 0.3s var(--md-ease-spring);
}

.carousel-control-prev {
  left: auto;
  right: 5.5rem;
}

.carousel-control-next {
  right: 1.5rem;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: var(--md-accent) !important;
  transform: scale(1.08);
}

.carousel-indicators {
  z-index: 3;
  margin-bottom: 1.25rem;
}

.carousel-indicators li {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  transition:
    transform 0.3s var(--md-ease-out),
    background 0.3s;
}

.carousel-indicators .active {
  background: #fff;
  transform: scale(1.25);
  border-color: #fff;
}

/* ——— Marquee strip ——— */
.md-marquee {
  position: relative;
  overflow: hidden;
  background: var(--km-ceo-bg);
  color: #fff;
  padding: 0.65rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.md-marquee__track {
  display: flex;
  width: max-content;
  gap: 3rem;
  animation: mdMarquee 38s linear infinite;
  font-family: var(--md-font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.9;
}

.md-marquee__track span {
  position: relative;
  padding-right: 3rem;
}

.md-marquee__track span::after {
  content: "·";
  position: absolute;
  right: 1.25rem;
  opacity: 0.35;
}

@keyframes mdMarquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ——— Section rhythm ——— */
.md-section-dark {
  background: var(--km-ceo-bg);
  color: var(--md-white);
  position: relative;
}

.md-section-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 20% 40%, rgba(14, 29, 66, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(14, 29, 66, 0.16), transparent 50%);
  pointer-events: none;
}

.md-section-dark .container,
.md-section-dark .container-fluid {
  position: relative;
  z-index: 1;
}

.md-section-dark .heading_container h2,
.md-section-dark h2,
.md-section-dark h3,
.md-section-dark .detail-box h5 {
  color: #fff !important;
}

.md-section-dark p,
.md-section-dark .detail_p_mt {
  color: var(--md-muted) !important;
}

.about_section.md-section-dark .img-box img {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.md-kicker {
  font-family: var(--md-font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--md-accent-bright);
  margin-bottom: 0.75rem;
}

.md-display-line {
  font-family: var(--md-font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: #fff;
  margin-bottom: 1rem;
}

.md-section-title {
  font-family: var(--md-font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: #000;
  margin: 0;
}

.md-section-title .md-section-title__accent {
  display: block;
  margin-top: 0.2rem;
  background: linear-gradient(
    105deg,
    var(--color-blue-800) 0%,
    var(--md-accent) 45%,
    var(--md-accent-bright) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
}

.md-section-dark strong {
  color: var(--md-accent-bright) !important;
  font-weight: 700;
}

/* ——— Service / cards ——— */
.service_section .box {
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(180deg, #fff 0%, #fff 100%);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(14, 29, 66, 0.08);
  transition:
    transform 0.45s var(--md-ease-out),
    box-shadow 0.45s var(--md-ease-out),
    border-color 0.35s;
}

.service_section .box:hover {
  transform: translateY(-8px);
  border-color: rgba(14, 29, 66, 0.35);
  box-shadow:
    0 20px 50px rgba(14, 29, 66, 0.15),
    0 0 0 1px rgba(14, 29, 66, 0.18);
}

.service_section .box .detail-box h5 {
  font-family: var(--md-font-display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--md-accent), var(--color-blue-800));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
}

.training-card {
  border-radius: 16px !important;
  border-width: 1px !important;
  transition:
    transform 0.45s var(--md-ease-out),
    box-shadow 0.45s var(--md-ease-out) !important;
}

.training-card:hover {
  transform: translateY(-10px) !important;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12) !important;
}

/* ——— Footer polish ——— */
.footer_section {
  background: var(--km-ceo-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer_section p {
  color: var(--md-muted) !important;
}

.footer_section p a {
  color: #fff !important;
  transition: color 0.25s;
}

.footer_section p a:hover {
  color: var(--md-accent-bright) !important;
}

.back-to-top {
  transition:
    transform 0.35s var(--md-ease-spring),
    background 0.25s;
}

.back-to-top:hover {
  transform: translateY(-4px);
  background: var(--md-accent) !important;
}

/* ——— Reduced motion ——— */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-rise-slow,
  .reveal-tilt,
  .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }

  .md-marquee__track {
    animation: none;
  }

  .carousel-item .carousel-img,
  .carousel-item.active .carousel-img {
    animation: none !important;
    transform: none !important;
  }

  .md-cta-pill:hover,
  .service_section .box:hover,
  .training-card:hover {
    transform: none !important;
  }
}

@media (max-width: 767px) {
  .carousel-caption {
    left: 5%;
    bottom: 12%;
  }

  .carousel-control-prev {
    right: 4.5rem;
  }
}

/* ——— Small & medium: keep layout within viewport (no horizontal page drag) ——— */
@media (max-width: 1199.98px) {
  html {
    overflow-x: hidden;
  }

  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  body.page-site img,
  body.page-site video,
  body.page-site iframe,
  body.page-home img,
  body.page-home video,
  body.page-home iframe {
    max-width: 100%;
    height: auto;
  }

  body.page-site .row > [class*="col-"],
  body.page-home .row > [class*="col-"] {
    min-width: 0;
  }

  body.page-site .container,
  body.page-site .container-fluid,
  body.page-home .container,
  body.page-home .container-fluid {
    max-width: 100%;
  }

  body.page-site .hero_area,
  body.page-site .header_section,
  body.page-home .hero_area,
  body.page-home .header_section {
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* --- Non-home section flow choreography --- */
.page-site:not(.page-home) .km-scroll-section {
  position: relative;
  opacity: 0;
  transform: translate3d(0, 56px, 0) scale(0.985);
  filter: blur(5px) saturate(0.92);
  transition:
    opacity 0.95s var(--md-ease-out),
    transform 0.95s var(--md-ease-out),
    filter 0.95s var(--md-ease-out);
  transition-delay: var(--km-flow-delay, 0s);
  will-change: opacity, transform, filter;
}

.page-site:not(.page-home) .km-scroll-section.is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0) saturate(1);
}

.page-site:not(.page-home) .km-scroll-section--slide-left {
  transform: translate3d(-64px, 34px, 0) scale(0.988);
}

.page-site:not(.page-home) .km-scroll-section--slide-right {
  transform: translate3d(64px, 34px, 0) scale(0.988);
}

.page-site:not(.page-home) .km-scroll-section--tilt {
  transform: perspective(1100px) translate3d(0, 58px, 0) rotateX(7deg);
}

.page-site:not(.page-home) .km-scroll-section::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(135, 206, 235, 0.1), transparent 40%),
    radial-gradient(circle at 82% 78%, rgba(173, 216, 230, 0.08), transparent 44%);
  opacity: 0;
  transition: opacity 1.05s var(--md-ease-out);
}

.page-site:not(.page-home) .km-scroll-section.is-inview::after {
  opacity: 1;
}

/* Safety: section decorative layers must never block scroll/pointer near footer */
.page-site:not(.page-home) .km-scroll-section::before,
.page-site:not(.page-home) .km-scroll-section::after {
  pointer-events: none !important;
}

.page-site:not(.page-home) .km-scroll-section > * {
  pointer-events: auto;
}

.page-site:not(.page-home) .km-scroll-section > .container,
.page-site:not(.page-home) .km-scroll-section > .main2,
.page-site:not(.page-home) .km-scroll-section > .row {
  position: relative;
  z-index: 1;
}

.page-site:not(.page-home) .km-scroll-section > .container > *,
.page-site:not(.page-home) .km-scroll-section > .main2 > *,
.page-site:not(.page-home) .km-scroll-section > .row > * {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity 0.72s var(--md-ease-out),
    transform 0.72s var(--md-ease-out);
}

.page-site:not(.page-home) .km-scroll-section.is-inview > .container > *,
.page-site:not(.page-home) .km-scroll-section.is-inview > .main2 > *,
.page-site:not(.page-home) .km-scroll-section.is-inview > .row > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.page-site:not(.page-home) .km-scroll-section.is-inview > .container > *:nth-child(1),
.page-site:not(.page-home) .km-scroll-section.is-inview > .main2 > *:nth-child(1),
.page-site:not(.page-home) .km-scroll-section.is-inview > .row > *:nth-child(1) {
  transition-delay: 0.04s;
}

.page-site:not(.page-home) .km-scroll-section.is-inview > .container > *:nth-child(2),
.page-site:not(.page-home) .km-scroll-section.is-inview > .main2 > *:nth-child(2),
.page-site:not(.page-home) .km-scroll-section.is-inview > .row > *:nth-child(2) {
  transition-delay: 0.12s;
}

.page-site:not(.page-home) .km-scroll-section.is-inview > .container > *:nth-child(3),
.page-site:not(.page-home) .km-scroll-section.is-inview > .main2 > *:nth-child(3),
.page-site:not(.page-home) .km-scroll-section.is-inview > .row > *:nth-child(3) {
  transition-delay: 0.2s;
}

/* Richer sub-element motion in contact/service/about sections */
.page-site:not(.page-home) .km-scroll-section .km-contact-item,
.page-site:not(.page-home) .km-scroll-section .km-contact-btn,
.page-site:not(.page-home) .km-scroll-section .km-contact-faq details,
.page-site:not(.page-home) .km-scroll-section .km-service-card,
.page-site:not(.page-home) .km-scroll-section .km-about-pillar {
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(0.98);
  filter: blur(2px);
  transition:
    opacity 0.72s var(--md-ease-out),
    transform 0.72s var(--md-ease-out),
    filter 0.72s var(--md-ease-out);
  transition-delay: calc(0.1s + var(--km-item-i, 0) * 0.06s);
}

.page-site:not(.page-home) .km-scroll-section.is-inview .km-contact-item,
.page-site:not(.page-home) .km-scroll-section.is-inview .km-contact-btn,
.page-site:not(.page-home) .km-scroll-section.is-inview .km-contact-faq details,
.page-site:not(.page-home) .km-scroll-section.is-inview .km-service-card,
.page-site:not(.page-home) .km-scroll-section.is-inview .km-about-pillar {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}
