/* ==========================================================================
   QLYVION DESIGN SYSTEM
   Signature element: the "orbit" motif — a partial gradient ring that
   appears in the logo, section dividers, and hover states, representing
   connected, always-on infrastructure. Used once per view, never scattered.
   ========================================================================== */

:root {
  /* Brand palette (from brief) */
  --q-blue: #0D3D76;
  --q-blue-dark: #082a54;
  --q-gray: #4B5563;
  --q-accent: #4CC9F0;
  --q-accent-2: #8FE3FF;
  --q-light-blue: #89A8C4;
  --q-white: #FFFFFF;
  --q-ink: #0A0F1A;
  --q-mist: #F5F7FA;
  --q-border: #E4E9F0;

  /* Gradients */
  --q-grad-brand: linear-gradient(135deg, var(--q-blue) 0%, #1c4f8f 45%, var(--q-accent) 100%);
  --q-grad-deep: radial-gradient(120% 120% at 15% 0%, #143f7a 0%, var(--q-ink) 65%);
  --q-grad-glow: linear-gradient(120deg, var(--q-accent) 0%, var(--q-accent-2) 100%);

  /* Type */
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --container: 1200px;
  --container-wide: 1440px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.5s;

  /* Elevation */
  --shadow-sm: 0 2px 8px rgba(10, 15, 26, 0.06);
  --shadow-md: 0 8px 30px rgba(10, 15, 26, 0.08);
  --shadow-lg: 0 20px 60px rgba(13, 61, 118, 0.18);
}

[data-theme="dark"] {
  --q-white: #0A0F1A;
  --q-ink: #F5F7FA;
  --q-mist: #101826;
  --q-border: #1E2A3D;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--q-ink);
  background: var(--q-white);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--q-ink);
}
p { margin: 0 0 1em; color: var(--q-gray); }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

.skip-link.screen-reader-text {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--q-blue);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 8px 0;
}
.skip-link.screen-reader-text:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--q-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: var(--container-wide); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--q-blue);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--q-grad-glow);
  border-radius: 2px;
}
[data-theme="dark"] .eyebrow { color: var(--q-accent); }

.section { padding: 96px 0; }
.section--tight { padding: 64px 0; }
.section--muted { background: var(--q-mist); }
.section--dark { background: var(--q-grad-deep); color: #fff; }
.section--dark p { color: #B9C6DA; }
.section--dark h2, .section--dark h3 { color: #fff; }

.section-head { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.section-head.align-left { margin: 0 0 48px; text-align: left; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease), color 0.35s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--q-grad-brand);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-secondary {
  background: transparent;
  color: var(--q-blue);
  border-color: var(--q-border);
}
.btn-secondary:hover { border-color: var(--q-blue); background: rgba(13, 61, 118, 0.04); }
.section--dark .btn-secondary { color: #fff; border-color: rgba(255,255,255,0.25); }
.section--dark .btn-secondary:hover { background: rgba(255,255,255,0.08); }
.btn-ghost { color: var(--q-blue); font-weight: 600; }
.btn-ghost svg { transition: transform 0.3s var(--ease); }
.btn-ghost:hover svg { transform: translateX(4px); }

/* ---------- Glass card ---------- */
.glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-md);
}
.section--dark .glass {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.card {
  background: #fff;
  border: 1px solid var(--q-border);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }

/* ---------- Icon badge (reusable) ----------
   Generic on purpose: used on service cards, About page Mission/Vision,
   and anywhere else an icon needs the brand badge treatment. Previously
   this lived only inside `.service-card .svc-icon`, so an icon placed in a
   plain `.card` (e.g. the About page) got no styling at all — no size
   limit, no background — and rendered at raw browser-default SVG size in
   solid black. Fixed by making the badge a standalone component. The
   underlying "no icon ever renders unstyled" fix is in inc/icons.php,
   which now sets a default width/height on every icon SVG at the source. */
.svc-icon {
  width: 48px; height: 48px; border-radius: 13px;
  background: var(--q-grad-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; flex: none;
}
.svc-icon svg { width: 21px; height: 21px; }

/* ---------- Orbit signature (decorative, aria-hidden) ---------- */
.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--q-accent);
  border-right-color: var(--q-blue);
  opacity: 0.5;
  animation: orbit-spin 24s linear infinite;
}
@keyframes orbit-spin { to { transform: rotate(360deg); } }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--q-border);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
[data-theme="dark"] .site-header { background: rgba(10, 15, 26, 0.82); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: 76px;
}
.site-logo img, .site-logo svg { height: 32px; width: auto; }
.site-logo .logo-dark-mode { display: none; }
[data-theme="dark"] .site-logo .logo-light-mode { display: none; }
[data-theme="dark"] .site-logo .logo-dark-mode { display: block; }

.primary-nav { display: flex; align-items: center; gap: 4px; }
.primary-nav > ul { display: flex; align-items: center; gap: 4px; }
.primary-nav > ul > li { position: relative; }
.primary-nav > ul > li > a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--q-ink);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.primary-nav > ul > li > a:hover { background: var(--q-mist); color: var(--q-blue); }
.primary-nav .caret { width: 10px; height: 10px; transition: transform 0.25s var(--ease); opacity: 0.6; }
.menu-item-has-children:hover .caret { transform: rotate(180deg); }

/* Mega menu */
.mega-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 640px;
  max-width: 90vw;
  padding: 20px;
  border-radius: var(--radius-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.menu-item-has-children:hover .mega-menu,
.menu-item-has-children:focus-within .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
/* Override the generic .glass translucency here specifically — at 72% opacity,
   page content behind the menu was bleeding through and mixing with the menu's
   own text, making it hard to read. The mega menu needs to be near-opaque. */
.mega-menu.glass {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--q-border);
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .mega-menu.glass {
  background: rgba(10, 15, 26, 0.98);
  border-color: rgba(255, 255, 255, 0.12);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .mega-menu.glass { background: #FFFFFF; }
  [data-theme="dark"] .mega-menu.glass { background: #0A0F1A; }
}
.mega-menu a {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: background 0.2s var(--ease);
}
.mega-menu a:hover { background: var(--q-mist); }
.mega-menu .mm-icon {
  width: 38px; height: 38px; flex: none;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--q-grad-brand);
  color: #fff;
}
.mega-menu .mm-title { font-weight: 600; font-size: 0.9375rem; color: var(--q-ink); margin-bottom: 2px; }
.mega-menu .mm-desc { font-size: 0.8125rem; color: var(--q-gray); margin: 0; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--q-border);
  background: transparent;
  color: var(--q-ink);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.icon-btn:hover { background: var(--q-mist); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

/* Search overlay */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,15,26,0.6);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.search-overlay.is-open { opacity: 1; visibility: visible; }
.search-box {
  width: min(640px, 90vw);
  background: #fff;
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 12px;
}
.search-box input {
  flex: 1; border: none; outline: none; font-size: 1.125rem;
  padding: 14px 8px; font-family: var(--font-body);
}
.search-box .icon-btn { border: none; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--q-border);
  border-radius: 10px;
  background: transparent;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 18px; height: 2px; background: var(--q-ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-toggle.is-active span { background: transparent; }
.nav-toggle.is-active span::before { top: 0; transform: rotate(45deg); }
.nav-toggle.is-active span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 960px) {
  .primary-nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .primary-nav.is-open {
    display: flex; flex-direction: column; align-items: stretch;
    position: fixed; top: 76px; left: 0; right: 0; bottom: 0;
    background: var(--q-white); padding: 24px; overflow-y: auto; gap: 0;
  }
  .primary-nav.is-open > ul { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .primary-nav.is-open .mega-menu {
    position: static; width: 100%; opacity: 1; visibility: visible; transform: none;
    display: none; grid-template-columns: 1fr; box-shadow: none; padding: 8px 0 8px 16px; pointer-events: auto;
  }
  .primary-nav.is-open .menu-item-has-children.is-open .mega-menu { display: grid; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { background: var(--q-grad-deep); color: #fff; padding-top: 80px; }
.site-footer a { color: #B9C6DA; transition: color 0.25s var(--ease); }
.site-footer a:hover { color: #fff; }
.footer-top { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 48px; padding-bottom: 56px; }
.footer-brand p { color: #8A9AB3; max-width: 320px; }
.footer-col h4 { color: #fff; font-size: 0.9375rem; margin-bottom: 18px; }
.footer-col li { margin-bottom: 12px; font-size: 0.9375rem; }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
}
.footer-social a:hover { background: var(--q-grad-glow); border-color: transparent; }
.footer-social svg { width: 16px; height: 16px; }
.footer-newsletter { display: flex; gap: 8px; margin-top: 8px; }
.footer-newsletter input {
  flex: 1; padding: 12px 16px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06);
  color: #fff; outline: none; font-family: var(--font-body);
}
.footer-newsletter input::placeholder { color: #7C8CA5; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 24px 0 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.8125rem; color: #7C8CA5;
}
.footer-legal { display: flex; gap: 20px; }

@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--q-grad-brand); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- Floating WhatsApp ---------- */
.float-whatsapp {
  position: fixed; left: 24px; bottom: 24px; z-index: 90;
  width: 54px; height: 54px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s var(--ease);
}
.float-whatsapp:hover { transform: scale(1.08); }

/* ---------- Cookie consent ---------- */
.cookie-bar {
  position: fixed; left: 24px; right: 24px; bottom: 24px; z-index: 150;
  max-width: 640px; margin: 0 auto;
  background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: 20px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  transform: translateY(140%); transition: transform 0.5s var(--ease);
  border: 1px solid var(--q-border);
}
.cookie-bar.is-visible { transform: translateY(0); }
.cookie-bar p { margin: 0; font-size: 0.875rem; flex: 1 1 260px; }

@media (max-width: 640px) {
  .back-to-top { right: 16px; bottom: 16px; }
  .float-whatsapp { left: 16px; bottom: 16px; }
}
