@import "tailwindcss";

@theme {
  --color-primary: #9400a6;
  --color-secondary: #ffc500;
  --color-accent: #d807e4;
  --color-info: #0085c6;
  --color-ink: #0f172a;
  --color-paper: #ffffff;
  --color-cloud: #f7f7fb;
  --color-line: #ececf4;

  --font-family-sans: "Manrope", system-ui, -apple-system, sans-serif;
}

@layer base {
  body {
    font-family: var(--font-family-sans);
    color: var(--color-ink);
    background: #ffffff;
  }

  html {
    scroll-behavior: smooth;
  }
}

/* ============================================================
   MARQUEE / TICKER ANIMATION
   ============================================================ */
@keyframes scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   HERO ANIMATIONS  (above-fold: CSS direct, no IO)
   ============================================================ */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes heroSlideRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

.hero-animate {
  animation: heroFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--delay, 0ms);
}

.hero-frame {
  animation: heroSlideRight 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 180ms;
}

.animate-float-slow {
  animation: float 4s ease-in-out infinite;
}

/* ============================================================
   SCROLL REVEAL ANIMATIONS  (below-fold: IntersectionObserver)
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.reveal       { opacity: 0; transform: translateY(28px); }
.reveal-left  { opacity: 0; transform: translateX(-32px); }
.reveal-right { opacity: 0; transform: translateX(32px); }
.reveal-scale { opacity: 0; transform: scale(0.95); }

.reveal.is-visible       { animation: fadeUp    0.6s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: var(--delay, 0ms); }
.reveal-left.is-visible  { animation: fadeLeft  0.6s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: var(--delay, 0ms); }
.reveal-right.is-visible { animation: fadeRight 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: var(--delay, 0ms); }
.reveal-scale.is-visible { animation: scaleIn   0.5s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: var(--delay, 0ms); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right, .reveal-scale,
  .hero-animate, .hero-frame, .animate-float-slow {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* ============================================================
   GLASS HEADER
   ============================================================ */
#site-header {
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

#site-header.header-scrolled {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(236, 236, 244, 0.9);
  box-shadow: 0 1px 24px rgba(15, 23, 42, 0.07);
}

/* ============================================================
   NAV LINKS & USE CASES DROPDOWN
   ============================================================ */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(20, 20, 20, 0.65);
  transition: background 150ms, color 150ms;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #141414;
}

.nav-group {
  position: relative;
}

.nav-dropdown {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 0ms 150ms;
  pointer-events: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: 220px;
  border-radius: 16px;
  border: 1px solid var(--color-line);
  background: white;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
  z-index: 100;
}

.nav-group:hover .nav-dropdown,
.nav-dropdown:focus-within {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 150ms ease, transform 150ms ease;
  pointer-events: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: #374151;
  transition: background 120ms, color 120ms;
  text-decoration: none;
}

.dropdown-item:hover {
  background: rgba(148, 0, 166, 0.06);
  color: #9400a6;
}

/* ============================================================
   CHIP / BADGE PATTERN
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  padding: 4px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chip-purple { background: rgba(148, 0, 166, 0.10); color: #9400a6; }
.chip-gold   { background: rgba(255, 197, 0, 0.15);  color: #92700d; }
.chip-info   { background: rgba(0, 133, 198, 0.10);  color: #0085c6; }
.chip-accent { background: rgba(216, 7, 228, 0.10);  color: #d807e4; }
.chip-green  { background: rgba(34, 197, 94, 0.10);  color: #16a34a; }

/* ============================================================
   TRUST PILLS  (hero)
   ============================================================ */
.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  border: 1px solid #ececf4;
  background: white;
  padding: 5px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
}

.trust-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

/* ============================================================
   APP FRAME / OS CHROME  (hero)
   ============================================================ */
.app-frame-chrome {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: var(--color-cloud);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 24px 64px rgba(15, 23, 42, 0.14),
    0 8px 24px rgba(15, 23, 42, 0.08);
}

.app-frame-chrome img {
  display: block;
  width: 100%;
  border-radius: 0 0 15px 15px;
}

/* ============================================================
   FLOATING BADGES  (hero)
   ============================================================ */
.floating-badge {
  filter: drop-shadow(0 4px 12px rgba(15, 23, 42, 0.12));
}

@media (max-width: 1023px) {
  .floating-badge { display: none; }
}

/* ============================================================
   STAT COUNTERS  (social proof)
   ============================================================ */
.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: #141414;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.9375rem;
  color: #64748b;
  margin-top: 4px;
}

/* ============================================================
   USE CASE CARDS
   ============================================================ */
.use-case-card {
  border-radius: 24px;
  border: 1px solid var(--color-line);
  background: white;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 250ms, box-shadow 250ms, transform 250ms;
  text-decoration: none;
}

.use-case-card:hover {
  border-color: #9400a6;
  box-shadow: 0 8px 32px rgba(148, 0, 166, 0.10);
  transform: translateY(-3px);
}

.use-case-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.use-case-title {
  font-size: 1rem;
  font-weight: 700;
  color: #141414;
}

.use-case-desc {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.65;
  flex: 1;
}

.use-case-link {
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.use-case-link:hover {
  text-decoration: underline;
}

/* ============================================================
   INTEGRATION CARDS
   ============================================================ */
.integration-card {
  border-radius: 20px;
  border: 1px solid var(--color-line);
  background: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 200ms, box-shadow 200ms, transform 200ms;
}

.integration-card:hover {
  border-color: #c4b5d9;
  box-shadow: 0 4px 16px rgba(148, 0, 166, 0.07);
  transform: translateY(-2px);
}

.integration-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

.integration-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #141414;
}

.integration-desc {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.55;
}

/* ============================================================
   MODULE / FEATURE CARDS
   ============================================================ */
.module-card {
  border-radius: 24px;
  border: 1px solid var(--color-line);
  background: white;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 200ms, box-shadow 200ms;
}

.module-card:hover {
  border-color: #9400a6;
  box-shadow: 0 8px 32px rgba(148, 0, 166, 0.08);
}

.module-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.module-illustration {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #f1f5f9;
  display: block;
}

.module-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9400a6;
  margin-bottom: 4px;
}

.module-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #141414;
  line-height: 1.3;
}

.module-desc {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.65;
}

/* ============================================================
   AI PILLAR FEATURE POINTS
   ============================================================ */
.feature-point {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9375rem;
  color: #475569;
  line-height: 1.5;
}

.feature-point-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============================================================
   COUNTRY CODE DROPDOWN
   ============================================================ */
.country-dropdown {
  scrollbar-width: thin;
  scrollbar-color: var(--color-line) transparent;
}

.country-dropdown::-webkit-scrollbar { width: 4px; }
.country-dropdown::-webkit-scrollbar-track { background: transparent; }
.country-dropdown::-webkit-scrollbar-thumb { background: var(--color-line); border-radius: 2px; }

/* ============================================================
   TESTIMONIAL CARDS
   ============================================================ */
.testimonial-card {
  border-radius: 24px;
  border: 1px solid var(--color-line);
  background: white;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.testimonial-quote {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: #374151;
  flex: 1;
}

.testimonial-quote::before {
  content: '\201C';
  font-size: 2rem;
  line-height: 0;
  vertical-align: -0.5rem;
  color: #9400a6;
  margin-right: 2px;
}

/* ============================================================
   WORKFLOW TAB PANEL TRANSITIONS
   ============================================================ */
.tab-panel-wrap {
  position: relative;
}

.tab-panel {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  transform: translateY(6px);
}

.tab-panel.tab-active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
  transform: translateY(0);
}

/* ============================================================
   MOBILE NAV ITEMS
   ============================================================ */
.mobile-nav-item {
  display: block;
  padding: 12px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #141414;
  border-bottom: 1px solid var(--color-line);
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}

.mobile-nav-item:last-child { border-bottom: none; }

.mobile-nav-sub {
  display: block;
  padding: 8px 12px;
  font-size: 0.9375rem;
  color: #475569;
  border-radius: 10px;
  text-decoration: none;
  transition: background 120ms, color 120ms;
}

.mobile-nav-sub:hover {
  background: rgba(148, 0, 166, 0.06);
  color: #9400a6;
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #9400a6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(148, 0, 166, 0.35);
  transition: transform 150ms, box-shadow 150ms;
  cursor: pointer;
  border: none;
}

#back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(148, 0, 166, 0.45);
}

/* ============================================================
   INLINE SVG PLACEHOLDER ILLUSTRATIONS  (modules 4-6)
   ============================================================ */
.module-svg-placeholder {
  border-radius: 14px;
  overflow: hidden;
}

/* ============================================================
   FORM VALIDATION STATES
   ============================================================ */
.field-invalid input,
.field-invalid select,
.field-invalid textarea {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15) !important;
}

.field-invalid .phone-wrapper {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15) !important;
}

.field-error {
  display: block;
  margin-top: 5px;
  font-size: 0.75rem;
  color: #ef4444;
  font-weight: 500;
}

/* ============================================================
   FORM FEEDBACK  (success / error banner)
   ============================================================ */
#form-feedback {
  display: none;
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  align-items: center;
  gap: 10px;
}

#form-feedback.show { display: flex; }

#form-feedback.success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
}

#form-feedback.error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
}

/* Submit button loading state */
#submit-btn[data-loading="true"] {
  opacity: 0.7;
  pointer-events: none;
  cursor: not-allowed;
}

/* ============================================================
   MARQUEE PAUSE ON HOVER
   ============================================================ */
.marquee-track:hover {
  animation-play-state: paused;
  cursor: default;
}

/* ============================================================
   PIPELINE PROGRESS BAR ANIMATION
   ============================================================ */
.progress-bar {
  width: 0;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   ACTIVE NAV LINK ON SCROLL
   ============================================================ */
.nav-link.nav-active {
  color: #9400a6;
  font-weight: 700;
  background: rgba(148, 0, 166, 0.07);
}

/* ============================================================
   HERO ROTATING WORD
   ============================================================ */
@keyframes wordIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes wordOut {
  from { opacity: 1; transform: translateY(0);     }
  to   { opacity: 0; transform: translateY(-10px); }
}

#hero-word {
  display: inline-block;
  animation: wordIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#hero-word.word-exit {
  animation: wordOut 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ============================================================
   HERO MOUSE SPOTLIGHT
   ============================================================ */
#hero::before {
  content: '';
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mx, 50%) var(--my, 50%),
    rgba(148, 0, 166, 0.08),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
}

#hero.spotlight-active::before {
  opacity: 1;
}

/* ============================================================
   TESTIMONIALS CAROUSEL (mobile only, JS-controlled)
   ============================================================ */
#testimonial-track.carousel-active .testimonial-card {
  display: none;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#testimonial-track.carousel-active .testimonial-card.carousel-visible {
  display: flex;
  flex-direction: column;
  opacity: 1;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ececf4;
  transition: background 200ms, transform 200ms;
  cursor: pointer;
  border: none;
  padding: 0;
}

.carousel-dot.dot-active {
  background: #9400a6;
  transform: scale(1.35);
}

/* ============================================================
   REDUCED MOTION — disable all new animations
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  #hero-word,
  #hero-word.word-exit        { animation: none !important; }
  .tab-panel                  { transition: none !important; }
  .progress-bar               { transition: none !important; }
  #testimonial-track.carousel-active .testimonial-card { transition: none !important; }
  .marquee-track              { animation-play-state: paused !important; }
  #hero::before               { transition: none !important; }
}

