html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* Scroll reveal-on-view animation */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Sticky header: compact state once the page has scrolled */
#site-header.is-scrolled {
  box-shadow: 0 8px 24px rgba(18, 46, 77, 0.10);
}
#site-header.is-scrolled #header-row {
  height: 64px;
}

/* Mobile nav toggle -> animated hamburger to close icon */
#nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
#nav-toggle.is-open span:nth-child(2) { opacity: 0; }
#nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Hide scrollbar for the services carousel while keeping it scrollable */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* Trusted-by marquee */
.marquee-track {
  animation: marquee 22s linear infinite;
  width: max-content;
}
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ======================================================================
   PREMIUM DESIGN-SYSTEM LAYER
   Shared by every page via css/custom.css — upgrades navbar, cards,
   buttons and imagery site-wide without touching each page's markup.
   ====================================================================== */

/* --- Glass navbar (single unified header component) ---------------- */
#navbar-main {
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  transition: background-color .4s ease, box-shadow .4s ease, border-color .4s ease;
}
#site-header.is-scrolled #navbar-main {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 30px rgba(18, 46, 77, 0.12);
  border-color: rgba(18, 46, 77, 0.08);
}
#site-header .hidden.sm\:block.bg-navy-deep {
  max-height: 36px;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.22,1,.36,1), opacity .3s ease;
}
#site-header.is-scrolled .hidden.sm\:block.bg-navy-deep {
  max-height: 0;
  opacity: 0;
}
#header-row { transition: height .35s cubic-bezier(.22,1,.36,1); }

/* Active nav dot + sliding pill highlight (see #nav-pill, driven by initNavHighlight in main.js) */
.nav-link { position: relative; border-radius: 9999px; }
.nav-link.text-saffron { font-weight: 600; }
.nav-link.text-saffron::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 3px;
  width: 4px; height: 4px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #F26B35, #FFB012);
}
#nav-pill { box-shadow: inset 0 0 0 1px rgba(242,107,53,0.14); }
#main-nav::-webkit-scrollbar { display: none; }
#main-nav { -ms-overflow-style: none; scrollbar-width: none; }

/* Mobile nav panel: smooth slide/fade instead of an abrupt show/hide.
   pointer-events is toggled explicitly so the closed (invisible) panel can
   never swallow taps meant for the page underneath it, and so it becomes
   tappable the instant it opens. */
.mobile-nav {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height .4s cubic-bezier(.22,1,.36,1), opacity .3s ease;
}
.mobile-nav.is-open {
  max-height: 80vh;
  opacity: 1;
  pointer-events: auto;
  box-shadow: 0 16px 32px -12px rgba(15,23,42,0.18);
}

/* Expanding nav search: icon opens a pill input inline */
#nav-search-form {
  transition: width .32s cubic-bezier(.22,1,.36,1), opacity .22s ease, margin-right .32s ease;
}
#nav-search-form.is-open {
  width: 190px !important;
  opacity: 1 !important;
  margin-right: .5rem;
}
#nav-search-toggle svg { transition: transform .25s ease; }
#nav-search-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }

/* --- Card lift: applies to every card using the shared shadow-soft
   utility across all 8 pages (services, packages, tests, blog, etc.) */
.shadow-soft {
  transition: transform .45s cubic-bezier(.22,1,.36,1),
              box-shadow .45s cubic-bezier(.22,1,.36,1),
              border-color .45s ease;
}
a.shadow-soft:hover, .shadow-soft:hover {
  transform: translateY(-8px);
  box-shadow: 0 26px 60px rgba(18, 46, 77, 0.18);
  border-color: rgba(242, 107, 53, 0.25);
}
.shadow-deep { transition: transform .5s cubic-bezier(.22,1,.36,1), box-shadow .5s ease; }

/* Image zoom inside any overflow-hidden rounded card on hover */
.rounded-2xl.overflow-hidden img,
.rounded-3xl.overflow-hidden img {
  transition: transform .6s cubic-bezier(.22,1,.36,1), filter .6s ease;
}
.shadow-soft:hover img, .shadow-deep:hover img {
  transform: scale(1.06);
}

/* Icon tiles get a subtle pop on card hover */
.shadow-soft:hover .rounded-xl.bg-navy-deep,
.shadow-soft:hover .rounded-full.bg-navy-deep {
  transform: translateY(-2px) scale(1.05);
}
.rounded-xl.bg-navy-deep, .rounded-full.bg-navy-deep {
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}

/* --- Buttons: arrow glide + soft glow ------------------------------ */
a.bg-saffron, button.bg-saffron {
  position: relative;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s ease, background-color .25s ease;
}
a.bg-saffron:hover, button.bg-saffron:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(242, 107, 53, 0.35);
}
a.bg-navy-deep:hover, button.bg-navy-deep:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(18, 46, 77, 0.28);
}
a[class*="border-navy-deep"]:hover, a[class*="border-white/40"]:hover {
  transform: translateY(-2px);
}
a.bg-saffron, a.bg-navy-deep, a[class*="border-2 border-navy-deep"] {
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s ease, background-color .25s ease, color .25s ease;
}
a span[aria-hidden="true"] { display: inline-block; transition: transform .3s ease; }
a:hover > span[aria-hidden="true"] { transform: translateX(4px); }

/* Shimmer sweep across saffron CTAs on hover — a single quiet moment of shine */
a.bg-saffron::before, button.bg-saffron::before {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 35%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-18deg);
  transition: left .65s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
}
a.bg-saffron:hover::before, button.bg-saffron:hover::before { left: 135%; }

/* --- Decorative gradient-mesh / blob background utilities ---------- */
.bg-mesh { position: relative; isolation: isolate; }
.bg-mesh::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 300px at 15% 20%, rgba(242,107,53,0.10), transparent 60%),
    radial-gradient(500px 260px at 85% 80%, rgba(18,46,77,0.08), transparent 60%);
}
.blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.blob-animate { animation: blobFloat 9s ease-in-out infinite; }
@keyframes blobFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(14px,-18px) scale(1.06); }
}

/* Floating stat card that overlaps a hero/media edge */
.float-card {
  animation: floatCard 5s ease-in-out infinite;
}
@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Stagger reveal delays — add data-delay="1".."6" on any .reveal element */
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.reveal[data-delay="5"] { transition-delay: .40s; }
.reveal[data-delay="6"] { transition-delay: .48s; }

/* Fine-grained reveal variants */
.reveal-scale { opacity: 0; transform: scale(.94); transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1); }
.reveal-scale.is-visible { opacity: 1; transform: scale(1); }
.reveal-left { opacity: 0; transform: translateX(-26px); transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1); }
.reveal-left.is-visible { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1); }
.reveal-right.is-visible { opacity: 1; transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  .blob-animate, .float-card { animation: none; }
}

/* Subtle noise/grid texture, used sparingly on dark sections */
.bg-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* Form inputs: focus glow */
input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(242, 107, 53, 0.15);
  border-color: #F26B35 !important;
}

/* --- Extra attractiveness pass ------------------------------------ */

/* Top accent bar — premium brand signature */
body { position: relative; }
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 60;
  background: linear-gradient(90deg, #F26B35, #FFB012, #1B4A73);
}

/* Gradient CTA buttons instead of flat saffron */
a.bg-saffron, button.bg-saffron {
  background-image: linear-gradient(135deg, #F26B35 0%, #FFB012 130%);
  background-color: #F26B35;
}
a.bg-saffron:hover, button.bg-saffron:hover {
  background-image: linear-gradient(135deg, #D9531F 0%, #F26B35 130%);
}

/* Slightly richer dark sections with a soft gradient instead of flat navy */
.bg-navy-deep {
  background-image: linear-gradient(160deg, #16375c 0%, #122E4D 60%, #0e2439 100%);
}

/* Headings: tighter, punchier tracking site-wide */
h1.font-display, h2.font-display, h3.font-display {
  letter-spacing: -0.01em;
}

/* Section eyebrow labels get a little gradient tick mark for polish (logo
   wordmark uses tracking-[0.12em] specifically, so it's left untouched) */
.text-saffron.uppercase {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-left: 1.05rem;
}
.text-saffron.uppercase::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 0.6rem; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #F26B35, #FFB012);
}

/* Branded text selection + a slim gradient scrollbar (WebKit + Firefox) */
::selection { background: rgba(242, 107, 53, 0.22); color: #122E4D; }
html { scrollbar-color: #F26B35 #F1EAD9; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #F1EAD9; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #F26B35, #FFB012);
  border-radius: 6px;
  border: 2px solid #F1EAD9;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #D9531F, #F26B35); }

/* Animated stat numbers (data-count) get the brand gradient rather than flat navy */
[data-count] {
  background: linear-gradient(135deg, #1B4A73, #F26B35);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Footer contact-icon circles lift and glow on hover */
footer a.rounded-full {
  transition: transform .3s cubic-bezier(.22,1,.36,1), background-color .25s ease, box-shadow .3s ease;
}
footer a.rounded-full:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 10px 22px rgba(242, 107, 53, 0.35);
}

/* Testimonial cards: a soft oversized quotation mark, added purely via CSS
   (no markup changes needed) plus a gentle lift on hover */
.marquee-card {
  position: relative;
  transition: transform .4s cubic-bezier(.22,1,.36,1), box-shadow .4s ease;
}
.marquee-card:hover { transform: translateY(-6px); box-shadow: 0 26px 60px rgba(18,46,77,0.16); }
.marquee-card::before {
  content: "\201C";
  position: absolute;
  top: -0.6rem; right: 1.1rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 4rem;
  line-height: 1;
  color: rgba(242, 107, 53, 0.14);
  pointer-events: none;
}

/* Links/buttons with a visible focus-visible ring for accessibility + polish */
a:focus-visible, button:focus-visible {
  outline: 2px solid #F26B35;
  outline-offset: 2px;
  border-radius: 4px;
}
