.niches {
  min-height: 100vh;
  min-height: 100dvh;

  border-top: 1px solid var(--border);
  background: var(--surface);
}

.niches__inner {
  min-height: 100vh;
  min-height: 100dvh;

  display: flex;
  flex-direction: column;
  justify-content: center;

  box-sizing: border-box;

  padding-top: 64px;
  padding-bottom: 64px;
}

.niches__eyebrow {
  margin-bottom: 24px;
}

.niches__title {
  color: var(--foreground);
  font-size: var(--font-title);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.niches__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.niches__grid > div {
  height: 100%;
}

.niche-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease;
}

.niche-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 32px;
}

.niche-card__icon {
  display: block;
  width: 24px;
  height: 24px;
  flex: none;
  color: var(--primary);
  transition: color 0.35s ease;
}

.niche-card__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.niche-card__title {
  min-height: 3.4rem;
  margin-top: 28px;
  color: var(--foreground);
  font-size: calc(var(--font-subtitle) * 1.2);
  line-height: 1.2;
  letter-spacing: -0.03em;
  transition: color 0.35s ease;
}

.niche-card__text {
  flex: 1;
  margin-top: 12px;
  color: var(--muted-foreground);
  font-size: calc(var(--font-small) * 1.2);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.03em;
  transition: color 0.35s ease;
}

.niche-card__image {
  width: 100%;
  height: 224px;
  overflow: hidden;
}

.niche-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.niche-card:hover {
  z-index: 1;
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
  transform: translateY(-6px);
  box-shadow:
    0 24px 50px -24px
    color-mix(in srgb, var(--primary) 65%, transparent);
}

.niche-card:hover .niche-card__icon {
  color: var(--accent);
}

.niche-card:hover .niche-card__title {
  color: var(--primary-foreground);
}

.niche-card:hover .niche-card__text {
  color: rgba(255, 255, 255, 0.72);
}

.niche-card:hover .niche-card__image img {
  transform: scale(1.06);
}

.niches__note {
  margin-top: 32px;
  padding-left: 20px;
  border-left: 4px solid var(--accent);
}

.niches__note p {
  color: var(--foreground);
  font-size: var(--font-text);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.niches__note strong {
  font-weight: 700;
}

.niches__note span {
  color: var(--muted-foreground);
}

.type-cursor {
  display: inline-block;
  margin-left: 4px;
  opacity: 1;
  animation: type-cursor-blink .8s steps(1) infinite;
}

.type-cursor.is-hidden {
  opacity: 0;
  animation: none;
}

@keyframes type-cursor-blink {
  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 991px) {

  .niches,
  .niches__inner {
    min-height: auto;
  }

  .niches__inner {
    display: block;
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .niches__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 44px;
  }
}

@media (max-width: 767px) {
  .niches__inner {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .niches__eyebrow {
    margin-bottom: 18px;
  }

  .niches__title {
    font-size: var(--font-title);
  }

  .niches__grid {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 36px;
  }

  .niche-card__content {
    padding: 24px;
  }

  .niche-card__title {
    min-height: 0;
    margin-top: 24px;
    font-size: calc(var(--font-subtitle) * 1.2);
  }

  .niche-card__text {
    font-size: calc(var(--font-small) * 1.2);
  }

  .niche-card__image {
    height: 220px;
  }

  .niches__note {
    margin-top: 28px;
    padding-left: 16px;
  }

  .niches__note p {
    font-size: var(--font-text);
  }
}

@media (max-width: 480px) {
  .niches__inner {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .niches__title {
    font-size: var(--font-title);
  }

  .niche-card__content {
    padding: 22px;
  }

  .niche-card__image {
    height: 200px;
  }

  .niches__note p {
    font-size: var(--font-text);
  }
}