:root {
  --hue: 27;
  --sat: 69%;
  --white: hsl(0, 0%, 100%);
  --purple-primary: rgba(132, 0, 255, 1);
  --purple-glow: rgba(132, 0, 255, 0.2);
  --purple-border: rgba(132, 0, 255, 0.8);
  --border-color: #392e4e;
  --background-dark: #060010;
  color-scheme: light dark;
}

.card-grid {
  display: grid;
  gap: 0.5em;
  padding: 0.75em;
  max-width: 54em;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.5rem);
}

.magic-bento-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  aspect-ratio: 4/3;
  min-height: 200px;
  width: 100%;
  max-width: 100%;
  padding: 1.25em;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--background-dark);
  font-weight: 300;
  overflow: hidden;
  transition: all 0.3s ease;

  --glow-x: 50%;
  --glow-y: 50%;
  --glow-intensity: 0;
  --glow-radius: 200px;
}

.magic-bento-card--white {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #1f2937;
}

.magic-bento-card--white .magic-bento-card__header,
.magic-bento-card--white .magic-bento-card__content {
  color: #1f2937;
}

.magic-bento-card--white .magic-bento-card__label {
  color: #6b7280;
}

.magic-bento-card--white .magic-bento-card__title {
  color: #1f2937;
}

.magic-bento-card--white .magic-bento-card__description {
  color: #6b7280;
  opacity: 0.9;
}

/* Light colored cards (pastel blues and grays) */
.magic-bento-card--light {
  border: 1px solid rgba(87, 205, 255, 0.2);
  color: #1f2937;
}

.magic-bento-card--light .magic-bento-card__header,
.magic-bento-card--light .magic-bento-card__content {
  color: #1f2937;
}

.magic-bento-card--light .magic-bento-card__icon {
  color: #56cdff;
}

.magic-bento-card--light .magic-bento-card__title {
  color: #1f2937;
}

.magic-bento-card--light .magic-bento-card__description {
  color: #6b7280;
  opacity: 0.9;
}

.magic-bento-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.magic-bento-card__header,
.magic-bento-card__content {
  display: flex;
  position: relative;
  color: var(--white);
}

.magic-bento-card__header {
  gap: 0.75em;
  justify-content: space-between;
}

.magic-bento-card__content {
  flex-direction: column;
}

.magic-bento-card__label {
  font-size: 16px;
}

.magic-bento-card__icon {
  width: 20px;
  height: 20px;
  color: inherit;
}

.magic-bento-card--white .magic-bento-card__icon {
  color: #57cdff;
}

/* Text-only card centered content */
.magic-bento-card__content--text-only {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1em 1em 1em;
}

/* Centered icon container for text-only cards */
.magic-bento-card__icon-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1em;
}

/* Large icon for text-only cards */
.magic-bento-card__icon--large {
  width: 48px;
  height: 48px;
  color: #57cdff;
}

.magic-bento-card--light .magic-bento-card__icon--large {
  color: #56cdff;
}

.magic-bento-card__title,
.magic-bento-card__description {
  --clamp-title: 1;
  --clamp-desc: 2;
}

.magic-bento-card__title {
  font-weight: 400;
  font-size: 16px;
  margin: 0 0 0.25em;
}

.magic-bento-card__description {
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.9;
}

.magic-bento-card--text-autohide .magic-bento-card__title,
.magic-bento-card--text-autohide .magic-bento-card__description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.magic-bento-card--text-autohide .magic-bento-card__title {
  -webkit-line-clamp: var(--clamp-title);
  line-clamp: var(--clamp-title);
}

.magic-bento-card--text-autohide .magic-bento-card__description {
  -webkit-line-clamp: var(--clamp-desc);
  line-clamp: var(--clamp-desc);
}

@media (max-width: 599px) {
  .card-grid {
    grid-template-columns: 1fr;
    width: 90%;
    margin: 0 auto;
    padding: 0.5em;
  }

  .magic-bento-card {
    width: 100%;
    min-height: 180px;
  }
}

@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .magic-bento-card:nth-child(3) {
    grid-column: span 2;
    grid-row: span 2;
  }

  .magic-bento-card:nth-child(4) {
    grid-column: 1 / span 2;
    grid-row: 2 / span 2;
  }

  .magic-bento-card:nth-child(6) {
    grid-column: 4;
    grid-row: 3;
  }
}

/* Border glow effect */
.magic-bento-card--border-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  padding: 6px;
  background: radial-gradient(
    var(--glow-radius, 200px) circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(132, 0, 255, calc(var(--glow-intensity, 0) * 0.8)) 0%,
    rgba(132, 0, 255, calc(var(--glow-intensity, 0) * 0.4)) 30%,
    transparent 60%
  );
  border-radius: inherit;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
          mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: source-out;
          mask-composite: subtract;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1;
}

/* Custom glow color for white and light cards with #57cdff */
.magic-bento-card--white.magic-bento-card--border-glow::after,
.magic-bento-card--light.magic-bento-card--border-glow::after {
  background: radial-gradient(
    var(--glow-radius, 200px) circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(87, 205, 255, calc(var(--glow-intensity, 0) * 0.8)) 0%,
    rgba(87, 205, 255, calc(var(--glow-intensity, 0) * 0.4)) 30%,
    transparent 60%
  );
}

.magic-bento-card--border-glow:hover::after {
  opacity: 1;
}

.magic-bento-card--border-glow:hover {
  box-shadow:
    0 4px 20px rgba(46, 24, 78, 0.4),
    0 0 30px var(--glow-color);
}

/* Custom glow for #57cdff */
.magic-bento-card--white.magic-bento-card--border-glow:hover,
.magic-bento-card--light.magic-bento-card--border-glow:hover {
  box-shadow:
    0 4px 20px rgba(87, 205, 255, 0.2),
    0 0 30px rgba(87, 205, 255, 0.3);
}

.particle-container {
  position: relative;
  overflow: hidden;
}

.particle::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: rgba(132, 0, 255, 0.2);
  border-radius: 50%;
  z-index: -1;
}

.particle-container:hover {
  box-shadow:
    0 4px 20px rgba(46, 24, 78, 0.2),
    0 0 30px var(--purple-glow);
}

/* Global spotlight styles */
.global-spotlight {
  mix-blend-mode: screen;
  will-change: transform, opacity;
  z-index: 200 !important;
  pointer-events: none;
}

.bento-section {
  position: relative;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.magic-bento-card__image {
  width: 100%;
  margin-bottom: 1em;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.magic-bento-card__image img {
  width: 100%;
  height: auto;
  display: block;
  -o-object-fit: cover;
     object-fit: cover;
  border-radius: 12px;
}

.magic-bento-card__image--crop-top {
  overflow: hidden;
  position: relative;
}

.magic-bento-card__image--crop-top img {
  transform: translateY(-10%);
  width: 100%;
  height: 110%;
  -o-object-fit: cover;
     object-fit: cover;
  -o-object-position: center top;
     object-position: center top;
}

/* Specific crop for Documents image - 1% top crop */
.magic-bento-card__image--crop-documents img {
  transform: translateY(-1%);
  width: 100%;
  height: 101%;
  -o-object-fit: cover;
     object-fit: cover;
  -o-object-position: center top;
     object-position: center top;
}

/* Specific crop for Goals image - left side crop, 20% bigger */
.magic-bento-card__image--crop-goals img {
  transform: translateX(3.5%) scale(1.2);
  width: 101.5%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  -o-object-position: center top;
     object-position: center top;
}

/* Gradient fade effect at bottom of images */
.magic-bento-card__image-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 96px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.6), #ffffff);
  pointer-events: none;
  z-index: 3;
  border-radius: 0 0 12px 12px;
}


/* Remove top padding for cards with images but no header */
.magic-bento-card:has(.magic-bento-card__image):not(:has(.magic-bento-card__header)) {
  padding-top: 0;
}

/* Remove all bottom spacing for cards with images */
.magic-bento-card:has(.magic-bento-card__image) {
  padding: 0 1.25em 0.5em 1.25em; /* Only left/right padding, slight bottom padding */
  justify-content: flex-start; /* Change from space-between to flex-start */
  aspect-ratio: auto; /* Remove fixed aspect ratio to allow natural height */
  min-height: auto; /* Remove min-height constraint */
}

.magic-bento-card:has(.magic-bento-card__image) .magic-bento-card__content {
  margin-bottom: 0;
}

.magic-bento-card:has(.magic-bento-card__image) .magic-bento-card__image {
  margin-bottom: 1em; /* Restore spacing below image */
}

.magic-bento-card:has(.magic-bento-card__image) .magic-bento-card__title {
  margin-bottom: 0;
}

.magic-bento-card:has(.magic-bento-card__image) .magic-bento-card__description {
  margin-bottom: 0;
}

/* Custom grid for customization section */
.card-grid.customize-grid {
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .card-grid.customize-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Top left: Two text cards (Messages, Lead Sources) - above Goals */
  .card-grid.customize-grid .magic-bento-card:nth-child(1) {
    grid-column: 1 / span 1 !important;
    grid-row: 1;
    aspect-ratio: auto;
    min-height: auto;
  }
  
  .card-grid.customize-grid .magic-bento-card:nth-child(2) {
    grid-column: 2 / span 1 !important;
    grid-row: 1;
    aspect-ratio: auto;
    min-height: auto;
  }
  
  /* Top right: Goals image (spans 2 columns, 1 row) */
  .card-grid.customize-grid .magic-bento-card:nth-child(3) {
    grid-column: 3 / span 2 !important;
    grid-row: 1;
  }
  
  /* Middle right: Two text cards below Goals (Pricebook, Discounts) */
  .card-grid.customize-grid .magic-bento-card:nth-child(4) {
    grid-column: 3 / span 1 !important;
    grid-row: 2;
    aspect-ratio: auto;
    min-height: auto;
  }
  
  .card-grid.customize-grid .magic-bento-card:nth-child(5) {
    grid-column: 4 / span 1 !important;
    grid-row: 2;
    aspect-ratio: auto;
    min-height: auto;
  }
  
  /* Bottom left: Documents image (spans 2 columns, directly below Messages/Lead Sources) */
  .card-grid.customize-grid .magic-bento-card:nth-child(6) {
    grid-column: 1 / span 2 !important;
    grid-row: 2;
  }
}

