/* ============================================
   COMPANYWISE — why-companywise.css
   Why Us comparison section · Mobile-first
   Colour palette: design tokens
   ============================================ */

/* ---- Section ---- */
.why-section {
  position: relative;
  overflow: hidden;
  padding: var(--section-gap) 0;
}

/* ---- Background Pattern ---- */
.why-bg-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    color-mix(in srgb, var(--text) 4%, transparent) 1px,
    transparent 1px
  );
  background-size: var(--space-6) var(--space-6);
  pointer-events: none;
}

/* ---- Blur Accents ---- */
.why-blur-accent {
  position: absolute;
  width: var(--space-64);
  height: var(--space-64);
  border-radius: var(--rounded-full);
  opacity: var(--opacity-0);
  pointer-events: none;
  filter: blur(var(--blur-3xl));
  transition: opacity var(--duration-700) var(--ease-out);
}

.why-blur-accent.is-visible {
  opacity: var(--opacity-30);
}

.why-blur-accent--left {
  top: 0;
  left: calc(-1 * var(--space-32));
  background: var(--brand);
}

.why-blur-accent--right {
  bottom: 0;
  right: calc(-1 * var(--space-32));
  background: var(--cta);
}

@media (min-width: 1024px) {
  .why-blur-accent {
    width: var(--space-96);
    height: var(--space-96);
  }

  .why-blur-accent--left {
    left: calc(-1 * var(--space-24));
  }

  .why-blur-accent--right {
    right: calc(-1 * var(--space-24));
  }
}

/* ---- Container ---- */
.why-container {
  max-width: var(--max-w-7xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
  width: 100%;
  position: relative;
  z-index: var(--z-10);
}

@media (min-width: 768px) {
  .why-container {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 1024px) {
  .why-container {
    padding: 0 var(--space-8);
  }
}

/* ============================================
   Section Header
   ============================================ */

.why-header {
  text-align: center;
  margin-bottom: var(--space-10);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .why-header {
    margin-bottom: var(--space-14);
  }
}

/* Label Pill */
.why-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  padding: var(--space-1) var(--space-2-5);
  background: linear-gradient(
    to bottom right,
    var(--brand-bg),
    color-mix(in srgb, var(--blue-500) 8%, transparent)
  );
  border: var(--border-1) solid color-mix(in srgb, var(--brand) 15%, transparent);
  border-radius: var(--rounded-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--brand);
}

.why-label i {
  font-size: var(--text-sm);
}

/* Title */
.why-title {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-weight: var(--font-medium);
  color: var(--text);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
  max-width: var(--max-w-2xl);
}

/* Subtitle */
.why-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
  max-width: var(--max-w-xl);
}

@media (min-width: 768px) {
  .why-subtitle {
    font-size: var(--text-lg);
  }
}

/* ============================================
   Comparison Table
   ============================================ */

.why-table-wrapper {
  margin-bottom: var(--space-10);
}

@media (min-width: 768px) {
  .why-table-wrapper {
    margin-bottom: var(--space-14);
  }
}

.why-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--rounded-2xl);
  background: var(--surface);
  border: var(--border-1) solid var(--border);
  box-shadow: var(--shadow-sm);
}

.why-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  table-layout: fixed;
}

/* ---- Table Head ---- */
.why-th {
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-align: center;
  border-bottom: var(--border-1) solid var(--border);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

@media (min-width: 768px) {
  .why-th {
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-sm);
  }
}

.why-th--feature {
  text-align: left;
  width: 40%;
  text-transform: none;
  letter-spacing: var(--tracking-normal);
}

.why-th--highlight {
  background: color-mix(in srgb, var(--brand) 4%, transparent);
}

.why-th--competitor {
  color: var(--text-faint);
}

/* Brand Header Cell */
.why-th-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1-5);
}

.why-th-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--space-6);
  height: var(--space-6);
  border-radius: var(--rounded-lg);
  background: var(--brand-bg);
  color: var(--brand);
}

.why-th-brand-icon i {
  font-size: var(--text-sm);
}

.why-th-brand span {
  font-weight: var(--font-bold);
  color: var(--brand);
}

/* ---- Table Rows ---- */
.why-tr {
  opacity: var(--opacity-0);
  transform: translateY(var(--space-2));
  transition:
    opacity var(--duration-300) var(--ease-out),
    transform var(--duration-300) var(--ease-out);
}

.why-tr.is-visible {
  opacity: var(--opacity-100);
  transform: translateY(0);
}

/* ---- Table Cells ---- */
.why-td {
  padding: var(--space-3) var(--space-3);
  text-align: center;
  border-bottom: var(--border-1) solid var(--border);
  vertical-align: middle;
}

@media (min-width: 768px) {
  .why-td {
    padding: var(--space-4) var(--space-5);
  }
}

.why-td--feature {
  text-align: left;
}

.why-td--highlight {
  background: color-mix(in srgb, var(--brand) 4%, transparent);
}

.why-tr--last .why-td {
  border-bottom: none;
}

/* ---- Feature Label ---- */
.why-feature-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text);
}

.why-feature-label i {
  font-size: var(--text-base);
  color: var(--text-faint);
  flex-shrink: 0;
}

/* ---- Check / Cross / Partial Icons ---- */
.why-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.why-check i {
  font-size: var(--text-xl);
}

.why-check--yes i {
  color: var(--success);
}

.why-check--no i {
  color: color-mix(in srgb, var(--text-faint) 70%, transparent);
}

.why-check--partial i {
  color: var(--warning);
}

/* ============================================
   Bottom Highlights
   ============================================ */

.why-highlights {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

@media (min-width: 768px) {
  .why-highlights {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }
}

.why-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border-radius: var(--rounded-xl);
  border: var(--border-1) solid var(--border);
}

@media (min-width: 768px) {
  .why-highlight-item {
    flex-direction: column;
    text-align: left;
    padding: var(--space-5);
  }
}

/* Highlight Icon */
.why-highlight-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--space-10);
  height: var(--space-10);
  border-radius: var(--rounded-xl);
  flex-shrink: 0;
}

.why-highlight-icon i {
  font-size: var(--text-xl);
}

.why-highlight-icon--emerald {
  background: var(--success-bg);
  color: var(--success);
}

.why-highlight-icon--blue {
  background: var(--brand-bg);
  color: var(--brand);
}

.why-highlight-icon--amber {
  background: var(--warning-bg);
  color: var(--warning);
}

/* Highlight Content */
.why-highlight-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.why-highlight-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text);
  margin: 0;
}

@media (min-width: 768px) {
  .why-highlight-title {
    font-size: var(--text-base);
  }
}

.why-highlight-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
  margin: 0;
}
