/* ============================================
   EcomCompass — Light Pastel Design System
   Brand Kit Colors:
   #390F18  Deep burgundy
   #DCE057  Lime/chartreuse
   #E2D5E8  Lavender
   #023641  Dark teal
   #A6C8E0  Sky blue
   #F05524  Vibrant orange
   ============================================ */

/* --- CSS Variables --- */
:root {
  --burgundy: #390F18;
  --lime: #DCE057;
  --lavender: #E2D5E8;
  --teal: #023641;
  --sky: #A6C8E0;
  --orange: #F05524;

  /* Semantic tokens */
  --background: #F7F3F9;
  --background-alt: #EDE6F0;
  --foreground: #390F18;
  --heading: #023641;
  --card: #ffffff;
  --card-alt: #F0EDF3;
  --primary: #F05524;
  --primary-hover: #d94a1e;
  --primary-foreground: #ffffff;
  --secondary: #023641;
  --accent: #DCE057;
  --accent-soft: #f0eda4;
  --muted: #E2D5E8;
  --muted-foreground: #6b5470;
  --sky-soft: #d3e4f0;
  --border: #d4c8da;
  --border-light: #e8dfed;

  /* Gradients */
  --gradient-hero: linear-gradient(160deg, #F7F3F9 0%, #E2D5E8 35%, #d3e4f0 70%, #F7F3F9 100%);
  --gradient-cta: linear-gradient(135deg, #F05524, #f57a2e);
  --gradient-soft: linear-gradient(135deg, #E2D5E8 0%, #d3e4f0 100%);
  --gradient-card: linear-gradient(180deg, #ffffff 0%, #F7F3F9 100%);
  --gradient-banner: linear-gradient(135deg, #023641 0%, #064a5a 50%, #0a5e6e 100%);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(57, 15, 24, 0.06);
  --shadow-md: 0 4px 16px rgba(57, 15, 24, 0.08);
  --shadow-lg: 0 8px 32px rgba(57, 15, 24, 0.1);
  --shadow-card: 0 2px 12px rgba(57, 15, 24, 0.06);
  --shadow-hover: 0 8px 30px rgba(240, 85, 36, 0.12);
}

/* --- Base --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Instrument Serif', serif;
  color: var(--heading);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; height: auto; display: block; }

/* --- Utility Classes --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
}

.section-sm {
  padding: 4rem 0;
}

.text-primary { color: var(--primary); }
.text-teal { color: var(--teal); }
.text-muted { color: var(--muted-foreground); }

.font-mono { font-family: 'JetBrains Mono', monospace; }

.gradient-text {
  background: linear-gradient(135deg, var(--orange), #c44118);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Soft texture pattern --- */
.dot-pattern {
  background-image: radial-gradient(rgba(57, 15, 24, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--gradient-cta);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-sm), 0 0 0 0 rgba(240, 85, 36, 0);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover), 0 0 0 4px rgba(240, 85, 36, 0.12);
}

.btn-secondary {
  background: var(--card);
  color: var(--teal);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--teal);
  background: var(--background);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: 0.625rem 1.5rem;
  font-size: 0.85rem;
}

/* --- Cards --- */
.card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-card);
}

.card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--teal);
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: all 0.3s ease;
}

.header.scrolled {
  background: rgba(247, 243, 249, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  padding: 0.75rem 0;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  height: 80px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 0.2s ease;
  position: relative;
}

.header-nav a:hover {
  color: var(--teal);
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--orange);
  border-radius: 1px;
  transition: width 0.3s ease;
}

.header-nav a:hover::after {
  width: 100%;
}

/* Nav dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 0.5rem;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-lg);
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--foreground);
}

.nav-dropdown-menu a:hover {
  background: var(--muted);
  color: var(--teal);
}

.nav-dropdown-menu a::after {
  display: none;
}

/* Mobile menu */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--teal);
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--background);
  z-index: 99;
  padding: 5rem 2rem 2rem;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a {
  display: block;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border-light);
  color: var(--teal);
}

.mobile-menu .mobile-sub {
  padding-left: 2rem;
  font-size: 0.95rem;
  color: var(--muted-foreground);
}

@media (max-width: 768px) {
  .header-nav { display: none; }
  .header-cta-desktop { display: none; }
  .mobile-toggle { display: block; }
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 5rem;
  background: var(--gradient-hero);
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(220, 224, 87, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(166, 200, 224, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 5rem);
  margin-bottom: 1.5rem;
  color: var(--teal);
}

.hero p {
  font-size: 1.2rem;
  color: var(--muted-foreground);
  max-width: 560px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Hero two-column layout */
.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  position: relative;
  z-index: 2;
}

/* Hero brand icon — right column */
.hero-brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 480px;
}

.hero-brand-icon {
  width: 320px;
  height: 320px;
  object-fit: contain;
  position: relative;
  z-index: 3;
  filter: drop-shadow(0 24px 60px rgba(2, 54, 65, 0.18))
          drop-shadow(0 8px 24px rgba(220, 224, 87, 0.12));
  animation: heroFloat 5s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-14px) rotate(1deg); }
}

/* Soft glow behind the icon */
.hero-brand-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%,
    rgba(220, 224, 87, 0.18) 0%,
    rgba(166, 200, 224, 0.14) 40%,
    transparent 70%);
  border-radius: 50%;
  animation: glowPulse 4s ease-in-out infinite;
  z-index: 1;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.08); }
}

/* Orbiting rings */
.hero-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(2, 54, 65, 0.1);
  z-index: 2;
}

.hero-ring-1 {
  width: 360px;
  height: 360px;
  animation: spinRing 18s linear infinite;
  border-color: rgba(220, 224, 87, 0.25);
  border-style: dashed;
}

.hero-ring-2 {
  width: 430px;
  height: 430px;
  animation: spinRing 28s linear infinite reverse;
  border-color: rgba(166, 200, 224, 0.2);
}

.hero-ring-3 {
  width: 500px;
  height: 500px;
  animation: spinRing 40s linear infinite;
  border-color: rgba(2, 54, 65, 0.07);
  border-style: dashed;
}

@keyframes spinRing {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .hero-layout {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content {
    max-width: 100%;
  }
  .hero-buttons {
    justify-content: center;
  }
  .hero-brand {
    height: 280px;
  }
  .hero-brand-icon {
    width: 200px;
    height: 200px;
  }
  .hero-ring-1 { width: 220px; height: 220px; }
  .hero-ring-2 { width: 260px; height: 260px; }
  .hero-ring-3 { width: 300px; height: 300px; }
}

@media (max-width: 640px) {
  .hero {
    min-height: auto;
    padding: 8rem 0 4rem;
  }
  .hero h1 { font-size: 2.5rem; }
  .hero-brand { display: none; }
}

/* --- Stats Bar --- */
.stats-bar {
  background: var(--card);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
  padding: 3rem 0;
}

.stat-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--orange);
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .stat-number { font-size: 2rem; }
}

/* --- Services Grid --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}

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

/* --- Industries Grid --- */
.industries-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.industry-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  border: 1px solid var(--border-light);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-card);
}

.industry-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: opacity 0.4s ease;
}

.industry-card.wine {
  background: linear-gradient(180deg, rgba(226, 213, 232, 0.5) 0%, #ffffff 60%);
}

.industry-card.wine::before {
  background: linear-gradient(180deg, rgba(57, 15, 24, 0.05) 0%, transparent 40%);
}

.industry-card.equestrian {
  background: linear-gradient(180deg, rgba(220, 224, 87, 0.15) 0%, #ffffff 60%);
}

.industry-card.equestrian::before {
  background: linear-gradient(180deg, rgba(220, 224, 87, 0.08) 0%, transparent 40%);
}

.industry-card.general {
  background: linear-gradient(180deg, rgba(166, 200, 224, 0.3) 0%, #ffffff 60%);
}

.industry-card.general::before {
  background: linear-gradient(180deg, rgba(2, 54, 65, 0.04) 0%, transparent 40%);
}

.industry-card:hover {
  transform: translateY(-6px);
  border-color: var(--border);
  box-shadow: var(--shadow-hover);
}

.industry-card > * {
  position: relative;
  z-index: 1;
}

.industry-card h3 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.industry-card p {
  color: var(--muted-foreground);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .industries-grid { grid-template-columns: 1fr; }
}

/* --- Apps Grid --- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .apps-grid { grid-template-columns: 1fr; }
}

/* --- CTA Banner --- */
.cta-banner {
  background: var(--gradient-banner);
  padding: 4.5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}

.cta-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(220, 224, 87, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.cta-banner h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: white;
  margin-bottom: 0.75rem;
  position: relative;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  position: relative;
}

.cta-banner .btn {
  position: relative;
  background: var(--gradient-cta);
  color: white;
  box-shadow: 0 4px 20px rgba(240, 85, 36, 0.3);
}

.cta-banner .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(240, 85, 36, 0.4);
}

/* --- Testimonials --- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.testimonial-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.testimonial-card blockquote {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted-foreground);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.testimonial-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--teal);
}

.testimonial-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--teal);
}

.testimonial-role {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

/* --- Section Headers --- */
.section-header {
  margin-bottom: 3.5rem;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--orange);
  margin-bottom: 0.75rem;
  display: block;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--muted-foreground);
  max-width: 600px;
  line-height: 1.7;
}

/* --- Footer --- */
.footer {
  background: var(--teal);
  color: rgba(255, 255, 255, 0.85);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin-top: 1rem;
  line-height: 1.7;
  max-width: 280px;
}

.footer-logo {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 1.25rem;
}

.footer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer ul a {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
}

.footer ul a:hover {
  color: var(--lime);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s ease;
}

.footer-social a:hover {
  color: var(--lime);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

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

/* --- Scroll Animations --- */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for children */
.stagger > *:nth-child(1) { transition-delay: 0s; }
.stagger > *:nth-child(2) { transition-delay: 0.1s; }
.stagger > *:nth-child(3) { transition-delay: 0.15s; }
.stagger > *:nth-child(4) { transition-delay: 0.2s; }
.stagger > *:nth-child(5) { transition-delay: 0.25s; }
.stagger > *:nth-child(6) { transition-delay: 0.3s; }

/* --- Misc --- */
.divider {
  width: 60px;
  height: 3px;
  background: var(--orange);
  border-radius: 2px;
}

.badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  background: rgba(220, 224, 87, 0.2);
  color: var(--teal);
  border: 1px solid rgba(220, 224, 87, 0.35);
}

/* Tag pills for features */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  background: var(--muted);
  color: var(--muted-foreground);
  border: 1px solid var(--border-light);
}

/* --- Colored top borders for app cards --- */
.card-border-orange { border-top: 3px solid var(--orange); }
.card-border-lime { border-top: 3px solid var(--lime); }
.card-border-sky { border-top: 3px solid var(--sky); }

/* --- Alt section backgrounds --- */
.section-alt {
  background: var(--card);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.section-lavender {
  background: linear-gradient(180deg, var(--background) 0%, rgba(226, 213, 232, 0.25) 50%, var(--background) 100%);
}
