/* ==========================================================================
   Quenavo — global.css
   Design tokens, base styles, layout, header, footer, hero
   Brand: Blue #2563EB · Purple #7C3AED · Navy #0F172A · White #FFFFFF
   ========================================================================== */

:root {
  /* Brand colors (refreshed, matches the Quenavo logo gradient) */
  --blue: #3B82F6;
  --purple: #8B5CF6;
  --navy: #0F172A;
  --navy-900: #0B1220;   /* fixed dark for hero/footer/dark sections */
  --white: #FFFFFF;

  /* Derived shades (brand-consistent) */
  --blue-dark: #2563EB;
  --purple-dark: #7C3AED;
  --navy-soft: #1E293B;
  --ink: #0F172A;
  --ink-soft: rgba(15, 23, 42, 0.72);
  --ink-faint: rgba(15, 23, 42, 0.55);
  --line: rgba(15, 23, 42, 0.09);
  --surface: #F5F7FD;
  --bg: #FFFFFF;
  --card: #FFFFFF;

  /* Adaptive header (light mode defaults) */
  --header-bg: rgba(255, 255, 255, 0.72);
  --header-bg-scrolled: rgba(255, 255, 255, 0.92);
  --header-ink: #0B1220;
  --header-ink-soft: rgba(11, 18, 32, 0.72);
  --header-field-bg: rgba(11, 18, 32, 0.05);
  --header-field-border: rgba(11, 18, 32, 0.12);
  --drawer-bg: #FFFFFF;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
  --grad-hero: linear-gradient(135deg, #0B1220 0%, #2563EB 58%, #8B5CF6 100%);
  --grad-hover: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);

  /* Glows */
  --glow-blue: rgba(59, 130, 246, 0.35);
  --glow-purple: rgba(139, 92, 246, 0.35);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.14);
  --shadow-glow: 0 10px 34px var(--glow-blue);
  --shadow-glow-purple: 0 10px 34px var(--glow-purple);

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Type */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: clamp(1.3rem, 2.5vw, 1.6rem);
  --fs-h2: clamp(1.7rem, 3.6vw, 2.4rem);
  --fs-h1: clamp(2.1rem, 5.2vw, 3.4rem);

  /* Spacing / layout */
  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section: clamp(3.5rem, 8vw, 6.5rem);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 0.18s;
  --t-med: 0.32s;
  --t-slow: 0.6s;

  /* Header */
  --header-h: 72px;
}

/* ------------------------------ Reset / base ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video, canvas { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }

h1, h2, h3, h4 {
  margin: 0 0 0.6em;
  line-height: 1.18;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-xl); font-weight: 700; }
h4 { font-size: var(--fs-lg); font-weight: 700; }
p { margin: 0 0 1em; }

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--purple); }

::selection { background: rgba(37, 99, 235, 0.18); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--blue);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 0 0 var(--r-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

/* ------------------------------- Layout ---------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section); }
.section--tint { background: var(--surface); }
.section--dark {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.82);
}
.section--dark h2, .section--dark h3 { color: #fff; }

.section-head {
  max-width: 640px;
  margin: 0 auto 3rem;
  text-align: center;
}
.section-head p { color: var(--ink-soft); font-size: var(--fs-lg); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--r-pill);
  padding: 0.3rem 0.9rem;
  margin-bottom: 1rem;
}

.grad-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------- Header ---------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: var(--header-h);
  transition: box-shadow var(--t-med) var(--ease);
}
/* The frosted-glass background lives on a pseudo-element: putting
   backdrop-filter on the header itself makes it a "containing block",
   which breaks the position:fixed mobile drawer inside it. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: background var(--t-med) var(--ease);
}
.site-header::after {
  /* gradient border revealed on scroll */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}
.site-header.is-scrolled {
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
}
.site-header.is-scrolled::before {
  background: var(--header-bg-scrolled);
}
.site-header.is-scrolled::after { opacity: 1; }

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--header-ink) !important;
  letter-spacing: -0.02em;
}
.site-footer .brand { color: #fff !important; }
.brand-logo {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
}
.brand-logo svg { width: 100%; height: 100%; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Primary nav */
.main-nav { margin-left: auto; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.8rem;
  color: var(--header-ink-soft);
  font-weight: 500;
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
  transition: color var(--t-fast) var(--ease);
  white-space: nowrap;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0.8rem; right: 0.8rem; bottom: 0.2rem;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease);
}
.nav-link:hover, .nav-link:focus-visible { color: var(--header-ink); }
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { color: var(--header-ink); }

/* Dropdowns */
.nav-item { position: relative; }
.nav-caret { transition: transform var(--t-fast) var(--ease); }
.nav-item.is-open .nav-caret { transform: rotate(180deg); }
.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 250px;
  background: var(--card);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), visibility var(--t-med);
  z-index: 20;
}
.nav-item.is-open .nav-dropdown,
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--r-sm);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav-dropdown a:hover { background: rgba(37, 99, 235, 0.07); color: var(--blue); }
.nav-dropdown .dd-all { color: var(--blue); font-weight: 600; border-top: 1px solid var(--line); margin-top: 0.35rem; }

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  place-items: center;
  color: var(--header-ink);
}

/* Theme (dark / light) toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--header-ink);
  background: var(--header-field-bg);
  border: 1px solid var(--header-field-border);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  flex: none;
}
.theme-toggle:hover { transform: rotate(12deg) scale(1.06); background: var(--header-field-border); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.nav-toggle svg { width: 26px; height: 26px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Push page content below fixed header */
main { padding-top: var(--header-h); }

/* -------------------------------- Hero ----------------------------------- */
.hero {
  position: relative;
  background: var(--grad-hero);
  color: #fff;
  overflow: hidden;
  padding-block: clamp(4rem, 10vw, 7.5rem);
}
.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}
.hero h1 { color: #fff; max-width: 15ch; }
.hero .hero-sub {
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--fs-lg);
  max-width: 46ch;
  margin-bottom: 2rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--r-pill);
  padding: 0.35rem 1rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 1.4rem;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.hero-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 10px #4ADE80;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: 2.2rem;
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.66);
}
.hero-trust span { display: inline-flex; align-items: center; gap: 0.4rem; }

/* Hero visual (floating 3D icons) */
.hero-visual {
  position: relative;
  min-height: 340px;
  display: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  pointer-events: none;
}
.blob--blue { width: 340px; height: 340px; background: var(--blue); top: -8%; right: -6%; }
.blob--purple { width: 300px; height: 300px; background: var(--purple); bottom: -12%; left: 4%; animation-delay: -6s; }

.float-card {
  position: absolute;
  width: 128px;
  height: 128px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.float-card svg { width: 62px; height: 62px; }
.float-card--pdf { top: 6%; left: 12%; box-shadow: 0 24px 60px var(--glow-blue), inset 0 1px 0 rgba(255,255,255,0.28); }
.float-card--jpg { top: 38%; right: 8%; width: 116px; height: 116px; box-shadow: 0 24px 60px var(--glow-purple), inset 0 1px 0 rgba(255,255,255,0.28); }
.float-card--conv { bottom: 4%; left: 26%; width: 108px; height: 108px; }

.particle {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

/* ------------------------------- Footer ---------------------------------- */
.site-footer {
  position: relative;
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.72);
  margin-top: auto;
}
.site-footer::before {
  /* animated top glow border */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), var(--purple), transparent);
  background-size: 200% 100%;
  animation: glowSlide 6s linear infinite;
}
.footer-grid {
  display: grid;
  gap: 2.4rem;
  padding-block: 3.5rem 2.5rem;
}
.footer-col h4 {
  color: #fff;
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.1rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.footer-col a {
  color: rgba(255, 255, 255, 0.66);
  font-size: var(--fs-sm);
  transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  display: inline-block;
}
.footer-col a:hover { color: #fff; transform: translateX(4px); }
.footer-desc { font-size: var(--fs-sm); max-width: 34ch; }

.footer-social { display: flex; flex-wrap: wrap; gap: 1.05rem; margin-top: 1.4rem; }
/* Plain logos — no tile, no border. Muted at rest; on hover each icon lifts
   slightly and takes on its platform's brand colour. */
.social-btn {
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.6);
  background: none;
  border: none;
  padding: 0;
  transition: transform var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
.social-btn svg { width: 24px; height: 24px; display: block; transition: transform var(--t-med) var(--ease); }
.social-btn:hover { transform: translateY(-3px); }
.social-btn:hover svg { transform: scale(1.08); }
.social-btn:active { transform: translateY(-1px); }
.social-btn:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 4px; }
.social-btn--fb:hover { color: #1877F2; }
.social-btn--ig:hover { color: #E4405F; }
.social-btn--x:hover  { color: #ffffff; }
.social-btn--th:hover { color: #ffffff; }

.footer-newsletter p { font-size: var(--fs-sm); }
.footer-why li { display: flex; align-items: flex-start; gap: 0.55rem; font-size: var(--fs-sm); color: rgba(255, 255, 255, 0.72); line-height: 1.45; }
.footer-why svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding-block: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-xs);
}
.footer-bottom a { color: rgba(255, 255, 255, 0.6); }
.footer-bottom a:hover { color: #fff; }

/* ---------------------------- Breadcrumbs -------------------------------- */
.breadcrumbs {
  padding-block: 1rem 0;
  font-size: var(--fs-xs);
}
.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--ink-faint); }
.breadcrumbs li + li::before { content: "/"; color: var(--line); }
.breadcrumbs a { color: var(--ink-soft); font-weight: 500; }
.breadcrumbs a:hover { color: var(--blue); }
.breadcrumbs [aria-current="page"] { color: var(--blue); font-weight: 600; }

/* ------------------------- Responsive: tablet up ------------------------- */
@media (min-width: 768px) {
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
  .hero-visual { display: block; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Desktop: the in-drawer search is hidden (header search is shown instead) */
@media (min-width: 1024px) {
  .main-nav .search-wrap { display: none; }
}

/* ------------------------- Responsive: laptop up ------------------------- */
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.3fr; }
}

/* ----------------------- Mobile navigation drawer ------------------------ */
@media (max-width: 1023px) {
  .nav-toggle { display: grid; }
  .main-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    z-index: 20;
    width: min(320px, 88vw);
    background: var(--drawer-bg);
    padding: 1.2rem 1.2rem 4rem;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform var(--t-med) var(--ease), visibility 0s linear var(--t-med);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -20px 0 60px rgba(15, 23, 42, 0.5);
    margin-left: 0;
  }
  .main-nav.is-open { transform: translateX(0); visibility: visible; transition: transform var(--t-med) var(--ease), visibility 0s; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0.2rem; }
  .nav-link { width: 100%; justify-content: space-between; padding: 0.8rem 0.9rem; font-size: var(--fs-md); }
  .nav-link::after { display: none; }
  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--header-field-bg);
    display: none;
    min-width: 0;
  }
  .nav-item.is-open .nav-dropdown { display: block; }
  .nav-dropdown a { color: var(--header-ink-soft); }
  .nav-dropdown a:hover { background: var(--header-field-border); color: var(--header-ink); }
  .header-cta { display: none; }
}

/* --------------------------- Reduced motion ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   DARK MODE
   Activated with [data-theme="dark"] on <html> (see the header toggle).
   The system preference is used as the default on first visit.
   ========================================================================== */
[data-theme="dark"] {
  --bg: #0B1220;
  --surface: #0E1729;
  --card: #121D34;
  --navy: #EDF2FB;                       /* headings flip to near-white */
  --ink: #E2E9F5;
  --ink-soft: rgba(226, 233, 245, 0.72);
  --ink-faint: rgba(226, 233, 245, 0.52);
  --line: rgba(255, 255, 255, 0.09);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.55);

  --header-bg: rgba(11, 18, 32, 0.55);
  --header-bg-scrolled: rgba(11, 18, 32, 0.88);
  --header-ink: #FFFFFF;
  --header-ink-soft: rgba(255, 255, 255, 0.74);
  --header-field-bg: rgba(255, 255, 255, 0.08);
  --header-field-border: rgba(255, 255, 255, 0.16);
  --drawer-bg: #0E1729;
}
[data-theme="dark"] .site-header.is-scrolled { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
[data-theme="dark"] .eyebrow { background: rgba(59, 130, 246, 0.14); }
[data-theme="dark"] ::selection { background: rgba(139, 92, 246, 0.35); }
