/* Feature grid: column-flow triptych with L-brackets + hash pattern. */
.feature-grid {
  position: relative;
  padding-block: clamp(4rem, 8vw, 6rem);
  overflow: hidden;
}

/* Very faint pattern behind the whole section for engineering texture.
   Uses the blueprint-grid utility at its default (light) intensity. */
.feature-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in oklch, var(--brand-blue) 4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklch, var(--brand-blue) 4%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  opacity: 0.6;
}

.feature-grid > .container { position: relative; }

.feature-grid__intro {
  max-width: 56rem;
  margin: 0 0 3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.feature-grid__heading {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  font-weight: var(--font-weight-display);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  max-width: 28ch;
  color: var(--color-foreground);
}

.feature-grid__deck {
  margin: 0;
  font-size: var(--fs-lg);
  color: var(--color-muted-foreground);
  max-width: 52ch;
  line-height: 1.45;
}

/* --- Triptych frame ------------------------------------------------- */

.feature-grid__frame {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-background);
  box-shadow: var(--shadow-sm);
}

.feature-grid__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

/* --- Column --------------------------------------------------------- */

.feature {
  position: relative;
  padding: 2rem 2rem 2.25rem;
  border-right: 1px solid var(--color-border);
  transition: background var(--dur-med) var(--ease);
}
.feature:last-child { border-right: 0; }

/* Thin teal accent that animates in on hover/focus of the card */
.feature::before {
  content: "";
  position: absolute;
  top: 0;
  left: 2rem;
  right: 2rem;
  height: 2px;
  background: var(--brand-teal);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-med) var(--ease);
}
.feature:hover::before,
.feature:focus-within::before { transform: scaleX(1); }

.feature__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--brand-teal) 8%, transparent);
  color: var(--brand-teal);
  border: 1px solid color-mix(in oklch, var(--brand-teal) 18%, transparent);
}

.feature__step {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.12em;
  color: var(--color-muted-foreground);
}

.feature__eyebrow {
  margin: 0 0 0.375rem;
  font-size: var(--fs-xs);
  font-weight: var(--font-weight-medium);
  color: var(--brand-teal);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feature__title {
  margin: 0 0 0.75rem;
  font-size: var(--fs-xl);
  font-weight: var(--font-weight-display);
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--color-foreground);
}

.feature__body {
  margin: 0 0 1.25rem;
  color: var(--color-muted-foreground);
  line-height: var(--lh-normal);
}

/* Thin animated sparkline beneath the title. Subtle visual cue
   that reinforces the "live orchestration" brand promise. */
.feature__spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 1.5rem;
  margin: 0.25rem 0 1rem;
  opacity: 0.65;
  transition: opacity var(--dur-med) var(--ease);
}
.feature:hover .feature__spark,
.feature:focus-within .feature__spark { opacity: 1; }

.feature__spark span {
  display: block;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    var(--brand-teal) 0%,
    color-mix(in oklch, var(--brand-teal) 50%, var(--brand-blue)) 100%
  );
  transform-origin: bottom center;
  animation: feature-spark 2.8s var(--ease) infinite;
  animation-delay: calc(var(--spark-i, 0) * 0.08s);
}
.feature__spark span:nth-child(odd)  { height: 60%; }
.feature__spark span:nth-child(even) { height: 100%; }

@keyframes feature-spark {
  0%, 100% { transform: scaleY(0.35); }
  25%      { transform: scaleY(0.75); }
  50%      { transform: scaleY(1); }
  75%      { transform: scaleY(0.55); }
}

@media (prefers-reduced-motion: reduce) {
  .feature__spark span { animation: none; transform: scaleY(0.7); }
}

.feature__link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--fs-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-foreground);
}
.feature__link:hover { color: var(--brand-teal); }
.feature__link .icon {
  transition: transform var(--dur-fast) var(--ease);
}
.feature__link:hover .icon { transform: translateX(2px); }

/* --- Responsive ----------------------------------------------------- */

@media (max-width: 960px) {
  .feature-grid__items {
    grid-template-columns: 1fr 1fr;
  }
  .feature:nth-child(2) { border-right: 0; }
  .feature:nth-child(3) {
    grid-column: 1 / -1;
    border-top: 1px solid var(--color-border);
  }
}

@media (max-width: 640px) {
  .feature-grid__items {
    grid-template-columns: 1fr;
  }
  .feature {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }
  .feature:last-child { border-bottom: 0; }
  .feature:nth-child(3) {
    grid-column: auto;
    border-top: 0;
  }
}
