/* ========================================================
   CleanEx Pest Co., Ltd. - Custom Styles & Micro-Animations
   Theme Colors:
     Midnight Navy: #102A43
     Jade Teal:     #00A88F
     Pearl White:   #F7FAFC
     Pure White:    #FFFFFF
     Dark Text:     #1F2937
     Light Gray:    #E5E7EB
   ======================================================== */

@import url("https://fonts.googleapis.com/css2?family=Kantumruy+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Noto+Sans+SC:wght@300;400;500;700&display=swap");

:root {
  --midnight-navy: #102a43;
  --midnight-navy-dark: #0b1c2d;
  --jade-teal: #00a88f;
  --jade-teal-hover: #008f7a;
  --jade-teal-light: #e6f7f4;
  --pearl-white: #f7fafc;
  --pure-white: #ffffff;
  --dark-text: #1f2937;
  --gray-border: #e5e7eb;
  --gray-subtle: #9ca3af;
}

html {
  /* Base 16px; all rem-based text scales from here */
  font-size: 100%;
  scroll-behavior: smooth;
  font-family:
    "Plus Jakarta Sans",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--dark-text);
  background-color: var(--pure-white);
}

/* Language font overrides */
html[lang="km"] body,
.lang-km {
  font-family: "Kantumruy Pro", "Plus Jakarta Sans", sans-serif !important;
}

html[lang="zh"] body,
.lang-zh {
  font-family: "Noto Sans SC", "Plus Jakarta Sans", sans-serif !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #00a88f;
}

/* Smooth glassmorphism */
.glass-nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px -2px rgba(16, 42, 67, 0.08);
}

.glass-badge {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.glass-card-navy {
  background: rgba(16, 42, 67, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Gradient accents */
.text-gradient-navy-teal {
  background: linear-gradient(135deg, #102a43 0%, #00a88f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bg-radial-glow {
  background: radial-gradient(
    circle at 50% 20%,
    rgba(0, 168, 143, 0.15) 0%,
    rgba(247, 250, 252, 0) 70%
  );
}

.bg-navy-pattern {
  background-color: #102a43;
  background-image:
    radial-gradient(#1e3a5f 0.75px, transparent 0.75px),
    radial-gradient(#1e3a5f 0.75px, #102a43 0.75px);
  background-size: 30px 30px;
  background-position:
    0 0,
    15px 15px;
}

/* Pulse animation for persistent widgets & status badges */
@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 168, 143, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 12px rgba(0, 168, 143, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 168, 143, 0);
  }
}

.pulse-ring-btn {
  animation: pulse-ring 2.5s infinite;
}

/* Floating animation */
@keyframes soft-float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

.animate-float {
  animation: soft-float 5s ease-in-out infinite;
}

/* Card hover transitions */
.hover-lift {
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 14px -6px rgba(16, 42, 67, 0.12);
}

/* Active tab state */
.filter-tab.active {
  background-color: #00a88f;
  color: #ffffff;
  border-color: #00a88f;
}

/* Keep project filters usable without wrapping into an oversized mobile block. */
.project-filters .project-filter-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Modals */
.modal-backdrop {
  background-color: rgba(16, 42, 67, 0.6);
  backdrop-filter: blur(6px);
}

/* Infinite Marquee for Client Logos */
@keyframes marquee {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

.marquee-track {
  display: flex;
  width: 200%;
  animation: marquee 35s linear infinite;
}
.marquee-track:hover {
  animation-play-state: paused;
}

/* Subtle image overlay shading */
.card-overlay-gradient {
  background: linear-gradient(
    180deg,
    rgba(16, 42, 67, 0.05) 0%,
    rgba(16, 42, 67, 0.85) 100%
  );
}

/* Shimmer shine effect for primary buttons */
.shimmer-btn {
  position: relative;
  overflow: hidden;
}
.shimmer-btn::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    60deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 80%
  );
  transform: rotate(25deg);
  animation: shimmer-effect 4.5s infinite;
}

@keyframes shimmer-effect {
  0% {
    left: -70%;
  }
  30%,
  100% {
    left: 140%;
  }
}

/* Hide scrollbar while keeping horizontal scroll (arrow-controlled strips) */
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Type scale (desktop / mobile)
   H1 56-64 / 36-40 · H2 36-40 / 28-32 · H3 24 / 20-22 · H4 20 / 18
   Body 16 · Small 12-14 · Buttons & nav 15-16 */
.text-\[8px\],
.text-\[9px\],
.text-\[10px\],
.text-\[11px\] {
  font-size: 0.75rem !important;
  line-height: 1.1rem !important;
}
.text-\[0\.78rem\] {
  font-size: 0.8125rem !important;
}
.text-\[0\.9rem\] {
  font-size: 0.9375rem !important;
}
.text-xs {
  font-size: 0.875rem !important;
  line-height: 1.35rem !important;
}
.text-sm,
.text-base {
  font-size: 1rem !important;
  line-height: 1.6rem !important;
}
.text-lg {
  font-size: 1.125rem !important;
  line-height: 1.75rem !important;
}
.text-xl {
  font-size: 1.125rem !important;
  line-height: 1.6rem !important;
}
.text-2xl {
  font-size: 1.25rem !important;
  line-height: 1.7rem !important;
}
h1 {
  font-size: 2.25rem !important;
  line-height: 1.15 !important;
}
h2 {
  font-size: 1.75rem !important;
  line-height: 1.2 !important;
}
@media (min-width: 640px) {
  .text-lg {
    font-size: 1.25rem !important;
  }
  .text-xl {
    font-size: 1.25rem !important;
    line-height: 1.7rem !important;
  }
  .text-2xl {
    font-size: 1.5rem !important;
    line-height: 2rem !important;
  }
  h1 {
    font-size: 2.5rem !important;
  }
  h2 {
    font-size: 2rem !important;
  }
}
@media (min-width: 1024px) {
  h1 {
    font-size: 3.5rem !important;
  }
  h2 {
    font-size: 2.5rem !important;
  }
}
@media (min-width: 1280px) {
  h1 {
    font-size: 4rem !important;
  }
}
p {
  line-height: 1.7;
}

/* Navbar glass effect on scroll */
#main-nav {
  transition:
    background-color 0.3s ease,
    backdrop-filter 0.3s ease,
    box-shadow 0.3s ease;
}
#main-nav.nav-glass {
  background-color: rgba(255, 255, 255, 0.55) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08) !important;
}

/* Responsive layout safeguards shared by every page */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
}

/* `clip` (not `hidden`) so body does not become a scroll container, which would break the sticky navbar. */
body {
  overflow-x: clip;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

/* Keep the mobile drawer usable on narrow phones. */
#mobile-drawer {
  width: min(20rem, calc(100vw - 1rem));
}

/* Prevent grid children and long translated strings from forcing overflow. */
footer .grid > div,
section .grid > div {
  min-width: 0;
}

@media (max-width: 1023px) {
  .max-w-8xl,
  .max-w-7xl {
    width: 100%;
  }

  footer .grid {
    row-gap: 2.5rem;
  }
}

@media (max-width: 639px) {
  html {
    font-size: 100%;
  }

  section {
    scroll-margin-top: 5rem;
  }

  footer {
    padding-top: 3rem !important;
    padding-bottom: 2.5rem !important;
  }

  footer .grid {
    gap: 2rem;
    padding-bottom: 2rem;
  }

  footer .grid > div.lg\:col-span-2 {
    grid-column: span 1 / span 1;
  }

  footer .flex.items-center.justify-between {
    align-items: flex-start;
  }

  footer .flex.items-center.justify-between > div:last-child {
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }

  /* Keep the floating contact controls clear of the viewport edges. */
  .fixed.bottom-6.right-6 {
    right: 1rem;
    bottom: 1rem;
  }
}

@media (max-width: 380px) {
  #mobile-drawer {
    width: calc(100vw - 0.5rem);
  }

  footer .whitespace-nowrap {
    font-size: 0.875rem !important;
    letter-spacing: 0.04em;
  }
}

/* Top utility bar: wrap instead of overflowing on tablets / small laptops. */
@media (max-width: 1279px) {
  .topbar > div {
    flex-wrap: wrap;
    row-gap: 0.4rem;
    column-gap: 1rem;
    justify-content: center;
  }

  .topbar > div > div {
    flex-wrap: wrap;
    row-gap: 0.25rem;
    column-gap: 1rem;
    justify-content: center;
  }

  .topbar .space-x-6 > :not([hidden]) ~ :not([hidden]),
  .topbar .space-x-5 > :not([hidden]) ~ :not([hidden]) {
    margin-left: 0;
  }
}

/* Footer text wraps at word boundaries; a word only breaks if it cannot fit its column at all. */
footer a,
footer p {
  overflow-wrap: break-word;
  word-break: normal;
}

/* Desktop footer: weight the columns by content so contact details and the partner heading are not squeezed. */
@media (min-width: 1024px) {
  footer .grid.lg\:grid-cols-6 {
    grid-template-columns: 1.5fr 1fr 1.1fr 1.8fr 1.4fr;
  }

  footer .grid.lg\:grid-cols-6 > div.lg\:col-span-2 {
    grid-column: span 1 / span 1;
  }
}

footer a.inline-flex {
  max-width: 100%;
}

/* Quote card: on tablets the card is full-width, so pin the photo to the right and keep copy clear of it. */
@media (min-width: 640px) and (max-width: 1279px) {
  .quote-hero {
    background-position: right 2rem bottom !important;
    min-height: 300px !important;
  }

  .quote-hero .quote-hero-text {
    width: 55%;
  }
}

@media (max-width: 639px) {
  .quote-hero {
    background-position: right -0.5rem bottom !important;
    background-size: auto 48% !important;
    min-height: 400px !important;
  }

  .quote-hero .quote-hero-text {
    width: 100%;
  }
}

/* Footer legal links stay on one line. */
footer .space-x-6 a {
  white-space: nowrap;
}
