/* ==========================================================================
   Xpress AI Co-Worker™ — Shared design system
   Tailwind handles layout utilities; this file holds the bespoke pieces:
   glass surfaces, glow borders, buttons, nav, modals, drawer, WhatsApp
   simulator skin, range sliders and motion.
   ========================================================================== */

:root {
  --bg: #090d16;
  --bg-deep: #05080e;
  --surface: rgba(15, 21, 34, 0.62);
  --line: rgba(255, 255, 255, 0.07);
  --brand: #ef401d;
  --brand-600: #d6330f;
  --brand-900: #6b1a0a;
  --blue: #38bdf8;
  --purple: #a855f7;
  --amber: #f59e0b;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html { background: var(--bg); }
body { background: var(--bg); }
body.no-scroll { overflow: hidden; }

::selection { background: var(--brand); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1f2937; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-600); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */
/* No backdrop-filter here: dozens of blurred cards on long pages cause scroll jank. */
.glass {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--line);
}

.lift {
  transition: transform 0.45s var(--ease-out), border-color 0.35s, box-shadow 0.45s var(--ease-out), background 0.35s;
}
.lift:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--c, var(--brand)) 45%, transparent);
  box-shadow: 0 24px 48px -24px color-mix(in srgb, var(--c, var(--brand)) 45%, transparent);
}

/* Cursor-following spotlight (coords set in main.js) */
.spotlight { position: relative; isolation: isolate; overflow: hidden; }
.spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--c, var(--brand)) 16%, transparent), transparent 60%);
}
.spotlight:hover::before { opacity: 1; }

/* Gradient hairline border */
.glow-border { position: relative; }
.glow-border::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(239, 64, 29, 0.7), rgba(56, 189, 248, 0.25) 40%, rgba(168, 85, 247, 0.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

/* Per-agent tint helpers (driven by --c) */
.tint-bg { background: color-mix(in srgb, var(--c) 12%, transparent); }
.tint-border { border-color: color-mix(in srgb, var(--c) 35%, transparent); }
.tint-text { color: var(--c); }
.tint-ring { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent), 0 10px 30px -10px color-mix(in srgb, var(--c) 60%, transparent); }

.text-gradient {
  background: linear-gradient(110deg, #ef401d 0%, #f66f48 55%, #ffb18f 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Background textures */
.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
}
.bg-dots {
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 0);
  background-size: 22px 22px;
}
.orb { position: absolute; border-radius: 9999px; filter: blur(110px); pointer-events: none; }

/* Section eyebrow pill */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f66f48;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  background: rgba(239, 64, 29, 0.08);
  border: 1px solid rgba(239, 64, 29, 0.22);
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 800;
  border-radius: 14px;
  white-space: nowrap;
  transition: transform 0.25s var(--ease-out), box-shadow 0.3s, background 0.3s, border-color 0.3s, color 0.3s;
}
.btn-primary {
  color: #1c0701;
  background: linear-gradient(110deg, #ef401d 0%, #f66f48 55%, #ffb18f 100%);
  box-shadow: 0 10px 30px -10px rgba(239, 64, 29, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(239, 64, 29, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-ghost {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(246, 111, 72, 0.4); color: #fff; }
.btn-ghost:active { transform: scale(0.98); }

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
#site-nav { transition: background 0.35s, border-color 0.35s, box-shadow 0.35s; border-bottom: 1px solid transparent; }
#site-nav.is-scrolled {
  background: rgba(9, 13, 22, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 40px -20px rgba(0, 0, 0, 0.8);
}
.nav-link {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 0.55rem 0.95rem;
  border-radius: 9999px;
  transition: color 0.25s, background 0.25s;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.nav-link.is-active { color: #fff; background: rgba(239, 64, 29, 0.14); box-shadow: inset 0 0 0 1px rgba(239, 64, 29, 0.35); }
.nav-link.is-active i { color: #f66f48; opacity: 1; }

/* AI Co-Workers megamenu (layout.js): the padded wrapper bridges the gap so hover never drops */
.mega-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  padding-top: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s var(--ease-out), transform 0.25s var(--ease-out), visibility 0s linear 0.25s;
  z-index: 60;
}
.nav-mega.is-open .mega-panel {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 0.2s var(--ease-out), transform 0.25s var(--ease-out), visibility 0s;
}
.nav-mega.is-open .nav-link { color: #fff; background: rgba(255, 255, 255, 0.05); }
.mega-chevron { transition: transform 0.25s var(--ease-out); }
.nav-mega.is-open .mega-chevron { transform: rotate(180deg); }
.mega-item:hover img, .mega-item:focus-visible img { box-shadow: 0 0 0 2px var(--c), 0 0 18px -2px var(--c); }
.mega-item:focus-visible { outline: 2px solid #f66f48; outline-offset: 1px; }

/* Mobile drawer */
.drawer { visibility: hidden; }
.drawer.open { visibility: visible; }
.drawer-backdrop { opacity: 0; transition: opacity 0.35s; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel { transform: translateX(100%); transition: transform 0.45s var(--ease-out); }
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-link { opacity: 0; transform: translateX(16px); transition: opacity 0.4s, transform 0.4s var(--ease-out), background 0.25s, border-color 0.25s; }
.drawer.open .drawer-link { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 8, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease both;
}
.modal-panel {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #111827 0%, #0b101b 100%);
  border: 1px solid rgba(239, 64, 29, 0.28);
  border-radius: 28px;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.03);
  animation: panelIn 0.45s var(--ease-out) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes panelIn { from { opacity: 0; transform: translateY(18px) scale(0.97); } to { opacity: 1; transform: none; } }

.field {
  width: 100%;
  background: #05080e;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  color: #fff;
  font-size: 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field::placeholder { color: #475569; }
.field:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(239, 64, 29, 0.15); }

/* --------------------------------------------------------------------------
   Preloader
   -------------------------------------------------------------------------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  transition: opacity 0.6s ease, visibility 0.6s;
}
#preloader.loaded { opacity: 0; visibility: hidden; }
#preloader.quick { transition-duration: 0.2s; }
.preloader-mark { position: relative; width: 64px; height: 64px; }
.preloader-mark span {
  position: absolute;
  inset: -14px;
  border-radius: 9999px;
  border: 1px solid rgba(239, 64, 29, 0.45);
  animation: ripple 1.8s var(--ease-out) infinite;
}
.preloader-mark span:nth-child(2) { animation-delay: 0.6s; }
.preloader-bar { width: 160px; height: 3px; border-radius: 9999px; background: #1e293b; overflow: hidden; }
.preloader-bar::after {
  content: '';
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef401d, #38bdf8);
  animation: loadbar 1.1s ease-in-out infinite;
}
@keyframes ripple { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes loadbar { from { transform: translateX(-110%); } to { transform: translateX(250%); } }

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
/* once revealed, an element stays fully visible (opacity is locked; transform stays free for tilt cards) */
.reveal.active { opacity: 1 !important; transform: none; }
.d-1 { transition-delay: 90ms; }
.d-2 { transition-delay: 180ms; }
.d-3 { transition-delay: 270ms; }
.d-4 { transition-delay: 360ms; }

/* Marquee */
.marquee { -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 42s linear infinite; will-change: transform; transform: translateZ(0); }
.marquee:hover .marquee-track { animation-play-state: paused; }
/* integrations marquee */
.marquee-track.reverse { animation-direction: reverse; }
.int-marquee .marquee-track { animation-duration: 55s; }
.int-marquee .marquee-track.reverse { animation-duration: 62s; }
.glass-card { background: rgba(15, 23, 42, 0.85); }
.int-pill { transition: border-color 0.3s, background 0.3s; }
.int-pill:hover { border-color: rgba(246, 111, 72, 0.5); background: rgba(30, 20, 18, 0.9); }
.int-pill i { font-size: 1.05rem; }
.int-letter { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 9999px; color: #fff; font: 800 10px/1 'Space Grotesk', sans-serif; letter-spacing: 0.02em; }
@keyframes marquee { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }

/* Hero activity feed items */
.feed-item { animation: feedIn 0.6s var(--ease-out) both; }
@keyframes feedIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Orbit rings in hero */
.ring { position: absolute; border-radius: 9999px; border: 1px dashed rgba(255, 255, 255, 0.07); }
.ring-dot { position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; border-radius: 9999px; transform: translateX(-50%); }

/* Live dot */
.live-dot { position: relative; display: inline-flex; width: 8px; height: 8px; border-radius: 9999px; background: #f66f48; }
.live-dot::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }

/* Timeline progress rail */
.rail-fill { transform-origin: left; transform: scaleX(0); transition: transform 1.6s var(--ease-out) 0.3s; }
.reveal.active .rail-fill, .rail-fill.active { transform: scaleX(1); }
.rail-fill-y { transform-origin: top; transform: scaleY(0); transition: transform 1.6s var(--ease-out) 0.3s; }
.reveal.active .rail-fill-y { transform: scaleY(1); }

/* FAQ accordion */
.faq-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s var(--ease-out); }
.faq-body > div { overflow: hidden; }
.faq.open .faq-body { grid-template-rows: 1fr; }
.faq .faq-icon { transition: transform 0.35s var(--ease-out); }
.faq.open .faq-icon { transform: rotate(45deg); }

/* --------------------------------------------------------------------------
   WhatsApp simulator skin
   -------------------------------------------------------------------------- */
.wa-bg {
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0);
  background-size: 16px 16px;
}
.wa-in { background: #202c33; color: #e9edef; border-radius: 14px; border-top-left-radius: 2px; }
.wa-out { background: #005c4b; color: #e9edef; border-radius: 14px; border-top-right-radius: 2px; }
.wa-msg { animation: bubbleIn 0.35s var(--ease-out) both; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px) scale(0.96); } to { opacity: 1; transform: none; } }
.wa-task { transition: background 0.25s, border-color 0.25s, opacity 0.3s; }
.wa-task.is-done { opacity: 0.55; border-color: rgba(239, 64, 29, 0.45) !important; background: rgba(6, 78, 59, 0.35) !important; cursor: default; }
.wa-task.is-done .wa-task-text { text-decoration: line-through; text-decoration-color: rgba(246, 111, 72, 0.7); }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing span { width: 6px; height: 6px; border-radius: 9999px; background: #8696a0; animation: typing 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }
.sim-scroll { scrollbar-width: thin; scrollbar-color: #26353d transparent; }
.sim-scroll::-webkit-scrollbar { width: 4px; }
.sim-scroll::-webkit-scrollbar-thumb { background: #26353d; }

/* --------------------------------------------------------------------------
   Range slider
   -------------------------------------------------------------------------- */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #ef401d 0%, #38bdf8 var(--fill, 50%), #1e293b var(--fill, 50%));
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: #fff;
  border: 5px solid #ef401d;
  box-shadow: 0 0 0 6px rgba(239, 64, 29, 0.18), 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s;
}
.range::-webkit-slider-thumb:hover { transform: scale(1.12); }
.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background: #fff;
  border: 5px solid #ef401d;
  box-shadow: 0 0 0 6px rgba(239, 64, 29, 0.18);
}

/* Scrollable chip row without visible bar */
.no-bar { scrollbar-width: none; }
.no-bar::-webkit-scrollbar { display: none; }

/* Policy typography */
.policy h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: #fff; font-size: 1.05rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.6rem; }
.policy h3 .num { font-size: 0.7rem; color: #f66f48; background: rgba(239, 64, 29, 0.1); border: 1px solid rgba(239, 64, 29, 0.25); border-radius: 8px; padding: 0.1rem 0.45rem; }
.policy p, .policy li { color: #cbd5e1; font-size: 0.875rem; line-height: 1.75; }
.policy ul { list-style: none; padding: 0; margin-top: 0.5rem; display: grid; gap: 0.35rem; }
.policy li { position: relative; padding-left: 1.4rem; }
.policy li::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; left: 0; top: 0.1rem; font-size: 0.7rem; color: #f66f48; }
.policy a { color: #f66f48; text-decoration: underline; text-underline-offset: 3px; }
.policy section { scroll-margin-top: 110px; }
.policy section + section { margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid rgba(255, 255, 255, 0.06); }

.toc-link.is-active { color: #fff; border-color: #ef401d; background: rgba(239, 64, 29, 0.08); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Hero Co-Worker pills */
.agent-pill:hover { border-color: color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }

/* Limited-time offer ticker (layout.js): continuous scroll, pauses on hover/focus, static for reduced motion */
.offer-track { animation: offerScroll 48s linear infinite; }
.offer-ticker:hover .offer-track, .offer-ticker:focus-visible .offer-track { animation-play-state: paused; }
.offer-ticker:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
@keyframes offerScroll { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .offer-track { animation: none; } }
