/* ───────────────────────────────────────────────────────────────
   Smart Analytica redesign — Nav + Hero
   (loads after redesign.css, which imports the design-system tokens)
─────────────────────────────────────────────────────────────────*/

/* ═══════════════ NAV ═══════════════ */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.82); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid transparent; transition: border-color var(--sa-dur-base) var(--sa-ease-out), box-shadow var(--sa-dur-base) var(--sa-ease-out); }
.nav.scrolled { border-bottom-color: var(--sa-border); box-shadow: var(--sa-shadow-100); }
.nav-inner { display: flex; align-items: center; height: 76px; gap: 36px; }
.brand { display: inline-flex; align-items: center; }
.brand img { height: 30px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-spacer { margin-left: auto; }
.nav-item { position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: 5px; padding: 10px 14px; border-radius: var(--sa-radius-sm); font-size: 14.5px; font-weight: 500; color: var(--sa-fg-1); line-height: 1; white-space: nowrap; transition: color var(--sa-dur-fast) var(--sa-ease-out), background var(--sa-dur-fast) var(--sa-ease-out); }
.nav-link:hover { color: var(--sa-blue); background: var(--sa-bg-2); }
.nav-caret { font-size: 10px; color: var(--sa-fg-3); transition: transform var(--sa-dur-base) var(--sa-ease-out); margin-top: 1px; }
.nav-item:hover .nav-caret { transform: rotate(180deg); color: var(--sa-blue); }
.nav-mega { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(8px); min-width: 288px; background: #fff; border: 1px solid var(--sa-border); border-radius: var(--sa-radius-lg); box-shadow: var(--sa-shadow-600); padding: 8px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--sa-dur-base) var(--sa-ease-out), transform var(--sa-dur-base) var(--sa-ease-out); }
.nav-mega::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.nav-item:hover .nav-mega { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.mega-row { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px; border-radius: var(--sa-radius-sm); transition: background var(--sa-dur-fast) var(--sa-ease-out); }
.mega-row:hover { background: var(--sa-bg-2); }
.mega-row .t { font-size: 14px; font-weight: 600; color: var(--sa-navy); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mega-row .t::after { content: "›"; color: var(--sa-fg-3); font-size: 16px; opacity: 0; transform: translateX(-4px); transition: opacity var(--sa-dur-fast), transform var(--sa-dur-fast); }
.mega-row:hover .t { color: var(--sa-blue); }
.mega-row:hover .t::after { opacity: 1; transform: translateX(0); }
.mega-row .d { font-size: 12.5px; color: var(--sa-fg-2); line-height: 16px; }
.nav-cta { margin-left: 8px; }
.nav-burger { display: none; width: 44px; height: 44px; border: 1px solid var(--sa-border); border-radius: var(--sa-radius-sm); background: #fff; align-items: center; justify-content: center; cursor: pointer; }
.nav-burger span, .nav-burger span::before, .nav-burger span::after { position: relative; width: 18px; height: 1.6px; background: var(--sa-navy); border-radius: 2px; }
.nav-burger span::before, .nav-burger span::after { content: ""; position: absolute; left: 0; }
.nav-burger span::before { top: -6px; }
.nav-burger span::after { top: 6px; }
@media (max-width: 1080px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: inline-flex; margin-left: auto; }
  /* Mobile dropdown — revealed by the burger (.open toggled in JS) */
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; top: 76px; left: 0; right: 0; margin-left: 0;
    background: #fff; border-bottom: 1px solid var(--sa-border); box-shadow: var(--sa-shadow-600);
    padding: 10px 22px 18px; max-height: calc(100vh - 76px); overflow-y: auto;
  }
  .nav-links.open .nav-item { width: 100%; }
  .nav-links.open .nav-link { position: relative; width: 100%; padding: 15px 56px 15px 6px; font-size: 16px; font-weight: 700; border-bottom: 1px solid var(--sa-border); border-radius: 0; }
  /* Caret becomes a tap-target that toggles the submenu (handled in nav.js) */
  .nav-links.open .nav-caret { display: flex; align-items: center; justify-content: center; position: absolute; top: 0; right: 0; bottom: 0; width: 56px; margin: 0; font-size: 13px; color: var(--sa-fg-2); transition: transform var(--sa-dur-base) var(--sa-ease-out); }
  .nav-links.open .nav-item.open-sub > .nav-link .nav-caret { transform: rotate(180deg); color: var(--sa-blue); }
  /* Sub-items collapsed by default; revealed only when the parent is open */
  .nav-links.open .nav-mega {
    display: none; position: static; opacity: 1; visibility: visible; pointer-events: auto;
    transform: none; min-width: 0; background: var(--sa-bg-2);
    border: 0; border-radius: 0; box-shadow: none; padding: 2px 0 6px;
  }
  .nav-links.open .nav-item.open-sub .nav-mega { display: block; }
  .nav-links.open .nav-mega .mega-row { padding: 12px 14px 12px 26px; border-radius: 0; border-bottom: 1px solid var(--sa-border); }
  .nav-links.open .nav-mega .mega-row:last-child { border-bottom: 0; }
  .nav-links.open .nav-mega .mega-row .t { font-size: 14.5px; font-weight: 500; color: var(--sa-fg-1); }
  .nav-links.open .nav-mega .mega-row .t::after { display: none; }
  .nav-links.open .nav-mega .mega-row .d { display: none; }
  /* CTA injected into the menu by nav.js */
  .nav-links.open .nav-menu-cta { display: inline-flex; justify-content: center; width: 100%; margin-top: 16px; border-bottom: 0; }
}
/* Hidden on desktop (the clone only belongs in the open mobile menu) */
.nav-menu-cta { display: none; }

/* ═══════════════ HERO ═══════════════ */
.hero { position: relative; overflow: hidden; padding: 56px 0 64px; background: #FCFCFD; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(820px 620px at 94% -14%, rgba(13,104,231,0.16), rgba(13,104,231,0) 62%),
    radial-gradient(720px 600px at 88% 120%, rgba(253,92,1,0.13), rgba(253,92,1,0) 58%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(3,43,80,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(3,43,80,0.04) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(ellipse at 22% 42%, #000 22%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 22% 42%, #000 22%, transparent 72%); }
.hero-grid { display: grid; grid-template-columns: 1.06fr 0.94fr; gap: 56px; align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; gap: 44px; } }

.hero-pill { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 11px; border-radius: var(--sa-radius-pill); background: rgba(253,92,1,0.09); border: 1px solid rgba(253,92,1,0.22); color: #B4430A; font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; }
.hero-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sa-orange); box-shadow: 0 0 0 4px rgba(253,92,1,0.16); animation: pulse 2.4s var(--sa-ease-in-out) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.hero h1 { margin: 22px 0 22px; font-size: clamp(44px, 5.4vw, 68px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 800; color: var(--sa-navy); }
.hero h1 .line { display: block; white-space: nowrap; }
.hero h1 .grad { display: block; white-space: nowrap; color: var(--sa-blue); }
/* On narrow phones the headline font hits its 44px floor and would overflow if forced single-line — allow it to wrap there. */
@media (max-width: 480px) { .hero h1 .line, .hero h1 .grad { white-space: normal; } }
.hero-lead { font-size: clamp(16.5px, 1.4vw, 19px); line-height: 1.55; color: var(--sa-fg-2); max-width: 540px; margin: 0 0 30px; }
.hero-lead strong { color: var(--sa-fg-1); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 34px; margin-top: 38px; padding-top: 30px; border-top: 1px solid var(--sa-border); max-width: 520px; }
.hero-stat .v { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; color: var(--sa-navy); line-height: 1; font-variant-numeric: tabular-nums; }
.hero-stat .v .pop { color: var(--sa-orange); }
.hero-stat .k { margin-top: 8px; font-size: 13px; line-height: 1.4; color: var(--sa-fg-2); max-width: 30ch; }
@media (max-width: 480px) { .hero-stats { grid-template-columns: 1fr; } }

/* Hero analytics card */
.hviz { position: relative; }
.hcard { position: relative; z-index: 2; background: #fff; border: 1px solid var(--sa-border); border-radius: var(--sa-radius-xl); box-shadow: var(--sa-shadow-700); padding: 24px 24px 22px; }
.hcard-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hcard-id { display: flex; align-items: center; gap: 10px; }
.hcard-id .glyph { width: 34px; height: 34px; border-radius: var(--sa-radius-sm); background: var(--sa-grad-spark); display: inline-flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 4px 12px -4px rgba(13,104,231,0.5); }
.hcard-id .glyph svg { width: 18px; height: 18px; }
.hcard-id b { font-size: 13.5px; color: var(--sa-navy); font-weight: 700; letter-spacing: -0.01em; }
.hcard-id span { font-size: 11px; color: var(--sa-fg-2); }
.hcard-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--sa-success); background: var(--sa-success-bg); padding: 5px 10px; border-radius: var(--sa-radius-pill); }
.hcard-live .ldot { width: 6px; height: 6px; border-radius: 50%; background: var(--sa-success); animation: pulse 1.6s var(--sa-ease-in-out) infinite; }
.hcard-big { display: flex; align-items: flex-end; gap: 10px; margin: 18px 0 2px; }
.hcard-big .n { font-size: 46px; font-weight: 800; letter-spacing: -0.03em; color: var(--sa-navy); line-height: 0.9; font-variant-numeric: tabular-nums; }
.hcard-big .u { font-size: 17px; font-weight: 600; color: var(--sa-fg-2); margin-bottom: 4px; }
.hcard-sub { font-size: 12.5px; font-weight: 600; color: var(--sa-success); display: flex; align-items: center; gap: 6px; }
.hcard-chart { margin: 14px 0 4px; }
.hcard-chart svg { width: 100%; height: 78px; display: block; }
.hcard-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 14px; }
.hcard-mini > div { background: var(--sa-bg-2); border-radius: var(--sa-radius-sm); padding: 11px 12px; }
.hcard-mini .l { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; color: var(--sa-fg-2); }
.hcard-mini .v { font-size: 16px; font-weight: 700; color: var(--sa-navy); margin-top: 4px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.hcard-float { position: absolute; z-index: 3; right: -22px; bottom: -26px; background: #fff; border: 1px solid var(--sa-border); border-radius: var(--sa-radius-lg); box-shadow: var(--sa-shadow-600); padding: 13px 15px; display: flex; align-items: center; gap: 11px; max-width: 250px; }
.hcard-float .ic { width: 38px; height: 38px; border-radius: var(--sa-radius-sm); background: rgba(13,104,231,0.10); color: var(--sa-blue); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hcard-float .ic svg { width: 20px; height: 20px; }
.hcard-float b { font-size: 13px; color: var(--sa-navy); font-weight: 700; }
.hcard-float span { font-size: 11px; color: var(--sa-fg-2); line-height: 1.35; display: block; margin-top: 1px; }
@media (max-width: 720px) { .hcard-float { display: none; } }

/* Hero certification badges (real partner badges) */
.hero-certs { margin-top: 64px; padding-top: 34px; border-top: 1px solid var(--sa-border); }
.hero-certs-label { text-align: center; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--sa-fg-3); margin: 0 0 24px; }
.hero-certs-label b { color: var(--sa-orange); }
.cert-marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.cert-track { display: flex; align-items: center; gap: 30px; width: max-content; animation: scroll-x 40s linear infinite; }
.cert-marquee:hover .cert-track { animation-play-state: paused; }
.cert-tile { flex-shrink: 0; height: 78px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--sa-border); border-radius: var(--sa-radius-md); box-shadow: var(--sa-shadow-100); }
.cert-tile img { max-height: 54px; max-width: 150px; width: auto; object-fit: contain; }
.cert-tile img.tall { max-height: 64px; }
.cert-tile img.wide { max-height: 26px !important; max-width: 108px !important; }
@media (prefers-reduced-motion: reduce) { .cert-track { animation: none; } .hero-pill .dot, .hcard-live .ldot { animation: none; } }
