/* ==========================================================================
   Professionals S.A.R.L — Premium Corporate Website
   Global stylesheet: custom properties, animations, glassmorphism helpers
   Tailwind handles utility styling; this file covers what utilities can't.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------------------------- */
:root {
  --primary: #0F766E;
  --secondary: #14B8A6;
  --accent: #F59E0B;
  --dark: #111827;
  --light: #F8FAFC;

  --grad-brand: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
  --grad-brand-accent: linear-gradient(135deg, #0F766E 0%, #14B8A6 55%, #F59E0B 130%);
  --grad-dark: linear-gradient(160deg, #0b1220 0%, #111827 60%, #0f2a27 100%);

  --shadow-soft: 0 10px 30px -12px rgba(15, 118, 110, 0.25);
  --shadow-lift: 0 24px 60px -20px rgba(15, 118, 110, 0.35);
  --ring-glass: rgba(255, 255, 255, 0.18);
}

/* ---------------------------------------------------------------------------
   2. Base
   --------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--dark);
  background: var(--light);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, .font-display {
  font-family: 'Poppins', 'Inter', sans-serif;
}

::selection {
  background: rgba(20, 184, 166, 0.25);
  color: var(--primary);
}

/* Custom scrollbar (progressive enhancement) */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #e2e8f0; }
::-webkit-scrollbar-thumb {
  background: var(--grad-brand);
  border-radius: 999px;
  border: 2px solid #e2e8f0;
}

/* ---------------------------------------------------------------------------
   3. Reusable brand utilities
   --------------------------------------------------------------------------- */
.gradient-text {
  background: var(--grad-brand-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-gradient { background: var(--grad-brand); }
.dark-gradient  { background: var(--grad-dark); }

/* Glassmorphism card */
.glass {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.glass-dark {
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Soft premium card shadow + lift on hover */
.card-soft {
  box-shadow: var(--shadow-soft);
  transition: transform .45s cubic-bezier(.16,1,.3,1), box-shadow .45s cubic-bezier(.16,1,.3,1);
  will-change: transform;
}
.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lift);
}

/* Gradient border effect */
.gradient-border {
  position: relative;
  background-clip: padding-box;
  border: 1px solid transparent;
}
.gradient-border::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad-brand);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Primary button with sheen micro-interaction */
.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--grad-brand);
  color: #fff;
  transition: transform .3s ease, box-shadow .3s ease;
  box-shadow: 0 12px 24px -10px rgba(15,118,110,.6);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -12px rgba(15,118,110,.7); }
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg);
  transition: left .7s ease;
}
.btn-primary:hover::after { left: 140%; }

/* ---------------------------------------------------------------------------
   4. Scroll-reveal animation states (driven by IntersectionObserver in JS)
   --------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal="zoom"]  { transform: scale(.9); }
[data-reveal="left"]  { transform: translateX(-48px); }
[data-reveal="right"] { transform: translateX(48px); }
[data-reveal].is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .floaty, .blob, .marquee-track { animation: none !important; }
}

/* ---------------------------------------------------------------------------
   5. Keyframe animations
   --------------------------------------------------------------------------- */
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-18px) rotate(2deg); }
}
.floaty { animation: floaty 6s ease-in-out infinite; }
.floaty-slow { animation: floaty 9s ease-in-out infinite; }

@keyframes blobMove {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(30px, -30px) scale(1.1); }
  66%      { transform: translate(-20px, 20px) scale(.95); }
}
.blob { animation: blobMove 18s ease-in-out infinite; }

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(10px); opacity: .5; }
}
.scroll-indicator { animation: bounceDown 2s ease-in-out infinite; }

@keyframes spinSlow { to { transform: rotate(360deg); } }
.spin-slow { animation: spinSlow 22s linear infinite; }

/* Hero headline word reveal */
.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(26px);
  animation: fadeUpWord .9s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes fadeUpWord { to { opacity: 1; transform: translateY(0); } }

/* ---------------------------------------------------------------------------
   6. Logo marquee (clients / certifications strip)
   --------------------------------------------------------------------------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------------------------------------------------------------------------
   7. Navbar states
   --------------------------------------------------------------------------- */
.navbar { transition: background .4s ease, box-shadow .4s ease, backdrop-filter .4s ease, padding .4s ease; }
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px -14px rgba(15, 23, 42, 0.25);
}
.navbar.scrolled .nav-link { color: #1f2937; }
.navbar.scrolled .nav-logo-text { color: var(--dark); }
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 2px; border-radius: 2px; background: var(--grad-brand);
  transition: width .3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* ---------------------------------------------------------------------------
   8. Process timeline connector
   --------------------------------------------------------------------------- */
.timeline-line { background: linear-gradient(180deg, var(--secondary), transparent); }

/* ---------------------------------------------------------------------------
   9. Accordion (FAQ)
   --------------------------------------------------------------------------- */
.faq-body { max-height: 0; overflow: hidden; transition: max-height .5s cubic-bezier(.16,1,.3,1); }
.faq-item.open .faq-body { max-height: 320px; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-icon { transition: transform .4s ease; }

/* ---------------------------------------------------------------------------
   10. Gallery + lightbox
   --------------------------------------------------------------------------- */
.gallery-item img { transition: transform .7s cubic-bezier(.16,1,.3,1); }
.gallery-item:hover img { transform: scale(1.12); }
.gallery-item { transition: opacity .4s ease, transform .4s ease; }
.gallery-item.hide { display: none; }

.lightbox { transition: opacity .35s ease; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { transition: transform .35s ease; }

.filter-btn.active { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-soft); }

/* ---------------------------------------------------------------------------
   11. Testimonials carousel
   --------------------------------------------------------------------------- */
.slide-track { transition: transform .6s cubic-bezier(.16,1,.3,1); }

/* ---------------------------------------------------------------------------
   12. Utility: hide scrollbar on horizontal strips
   --------------------------------------------------------------------------- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------------------------------------------------------------------------
   13. Hero slider (home) — crossfading full-screen slides
   --------------------------------------------------------------------------- */
.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}
.hero-slide.is-active { opacity: 1; pointer-events: auto; }

/* content of the active slide rises into place each time it becomes active */
.hero-slide .hero-rise {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1);
}
.hero-slide.is-active .hero-rise { opacity: 1; transform: none; }
.hero-slide.is-active .hero-rise:nth-child(1) { transition-delay: .15s; }
.hero-slide.is-active .hero-rise:nth-child(2) { transition-delay: .3s; }
.hero-slide.is-active .hero-rise:nth-child(3) { transition-delay: .45s; }
.hero-slide.is-active .hero-rise:nth-child(4) { transition-delay: .6s; }

/* slider dots (shared style for hero + services) */
.slider-dot {
  height: .625rem; width: .625rem; border-radius: 999px;
  background: rgba(255,255,255,.4);
  transition: all .35s ease;
}
.slider-dot.is-active { width: 2rem; background: var(--grad-brand); }

/* ---------------------------------------------------------------------------
   14. Services slider (home) — snap track
   --------------------------------------------------------------------------- */
.services-track { scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.services-track > article { scroll-snap-align: start; }

@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; }
  .hero-slide .hero-rise { opacity: 1; transform: none; transition: none; }
}

/* ---------------------------------------------------------------------------
   15. Mobile drawer — scrollable body so bottom items are always reachable
   --------------------------------------------------------------------------- */
[data-mobile-menu] { overflow-y: auto; overscroll-behavior: contain; }
[data-menu-backdrop] { transition: opacity .4s ease; }

/* ---------------------------------------------------------------------------
   16. Service detail modal (popup)
   --------------------------------------------------------------------------- */
[data-service-modal-root] { opacity: 0; transition: opacity .3s ease; }
[data-service-modal-root].is-open { opacity: 1; }
[data-service-modal-root] [data-modal-panel] {
  transform: translateY(24px) scale(.97);
  transition: transform .4s cubic-bezier(.16,1,.3,1);
}
[data-service-modal-root].is-open [data-modal-panel] { transform: none; }

/* typographic styling for the injected modal content */
[data-modal-body] h4 {
  font-family: 'Poppins', sans-serif; font-weight: 600;
  margin-top: 1.6rem; margin-bottom: .6rem; font-size: 1.05rem; color: var(--primary);
}
[data-modal-body] > p { color: #475569; line-height: 1.7; margin-top: .5rem; }
[data-modal-body] .lead { font-style: italic; color: #64748b; }
[data-modal-body] ul { margin-top: .6rem; display: grid; gap: .55rem; }
[data-modal-body] ul li {
  position: relative; padding-left: 1.85rem; color: #475569;
  font-size: .93rem; line-height: 1.55;
}
[data-modal-body] ul li::before {
  content: ""; position: absolute; left: 0; top: .2rem; width: 1.2rem; height: 1.2rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F766E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}
[data-modal-body] ul.plain li { padding-left: 0; }
[data-modal-body] ul.plain li::before { display: none; }
