.tool-feature,
.tool-preview {
  margin: 0;
}

.tool-gallery {
  position: relative;
  display: grid;
  min-height: 570px;
  gap: 18px;
  margin: 0;
  padding: 30px;
  border-radius: var(--cb-radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 86% 12%, rgba(227, 102, 69, 0.3), transparent 24%),
    linear-gradient(145deg, #1b1d49, #2b2d62);
  background-size: 28px 28px, 28px 28px, auto, auto;
  box-shadow: var(--cb-shadow);
}

.tool-gallery::before {
  position: absolute;
  top: 17px;
  right: 18px;
  width: 54px;
  height: 5px;
  border-radius: 999px;
  background: var(--cb-koi);
  content: "";
}

.tool-gallery--inside {
  isolation: isolate;
  overflow: hidden;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  padding: 42px 34px 34px 48px;
  border: 1px solid rgba(38, 39, 86, 0.12);
  background:
    linear-gradient(90deg, var(--cb-navy) 0 18px, transparent 18px),
    radial-gradient(circle at 92% 7%, rgba(227, 102, 69, 0.18), transparent 24%),
    linear-gradient(145deg, #f8f3e9, #e9decc);
  box-shadow: 0 28px 64px rgba(38, 39, 86, 0.2);
}

.tool-gallery--inside::before {
  z-index: 5;
  top: 20px;
  right: 22px;
  width: 46px;
  height: 4px;
}

.tool-gallery--inside .tool-gallery-frame {
  position: relative;
  border-color: rgba(38, 39, 86, 0.13);
  box-shadow: 0 18px 40px rgba(38, 39, 86, 0.2);
}

.tool-gallery--inside .tool-gallery-frame--tall {
  z-index: 2;
  transform: rotate(-0.65deg);
}

.tool-gallery--inside .tool-gallery-frame:nth-child(2) {
  transform: rotate(0.85deg);
}

.tool-gallery--inside .tool-gallery-frame:nth-child(3) {
  transform: rotate(-0.45deg);
}

.tool-gallery--inside .tool-gallery-frame img {
  object-fit: contain;
  background: #fff;
}

.tool-gallery-frame {
  display: grid;
  min-width: 0;
  overflow: hidden;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(7, 8, 31, 0.26);
}

.tool-gallery-frame--tall {
  grid-row: 1 / 3;
}

.tool-gallery-frame > div {
  min-height: 0;
  overflow: hidden;
  background: #eeece7;
}

.tool-gallery-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}

.tool-gallery-frame span {
  padding: 11px 13px;
  color: var(--cb-navy);
  background: rgba(255, 255, 255, 0.98);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.07em;
  line-height: 1.25;
  text-transform: uppercase;
}

.tool-gallery--dark {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 590px;
  padding: 34px;
  background:
    linear-gradient(rgba(38, 39, 86, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 39, 86, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 12% 12%, rgba(227, 102, 69, 0.32), transparent 28%),
    linear-gradient(145deg, #f4eee3, #e8ddcb);
  background-size: 28px 28px, 28px 28px, auto, auto;
  box-shadow: 0 32px 75px rgba(8, 9, 32, 0.38);
}

.tool-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 42px;
}

.tool-preview {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(38, 39, 86, 0.1);
  border-radius: 16px;
  background: var(--cb-paper);
  box-shadow: var(--cb-shadow-small);
}

.tool-preview > div {
  aspect-ratio: 0.82;
  overflow: hidden;
  background: #e7e6e2;
}

.tool-preview--wide > div {
  aspect-ratio: 0.82;
}

.tool-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
  transition: transform 180ms ease;
}

.tool-preview:hover img {
  transform: scale(1.025);
}

.tool-preview figcaption,
.tool-feature figcaption {
  padding: 15px 17px;
  color: var(--cb-navy);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.tool-preview + .feature-grid,
.tool-preview-grid + .feature-grid {
  margin-top: 42px;
}

.tool-feature {
  display: flex;
  min-height: 560px;
  align-items: center;
  justify-content: center;
  padding: 38px 38px 26px;
  background:
    radial-gradient(circle at 80% 16%, rgba(239, 189, 77, 0.25), transparent 28%),
    var(--cb-cream);
}

.tool-feature-sheet {
  width: min(78%, 390px);
  overflow: hidden;
  aspect-ratio: 0.707;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 28px 60px rgba(38, 39, 86, 0.2);
  transform: rotate(2deg);
}

.tool-feature-sheet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}

.tool-feature figcaption {
  position: absolute;
  align-self: flex-end;
  margin-bottom: -8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(38, 39, 86, 0.12);
}

@media (max-width: 820px) {
  .tool-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-gallery--inside,
  .tool-gallery--dark {
    width: min(100%, 620px);
    margin-inline: auto;
  }
}

@media (max-width: 580px) {
  .hero-grid {
    gap: 42px;
  }

  .tool-gallery {
    min-height: 470px;
    gap: 10px;
    padding: 20px;
  }

  .tool-gallery--dark {
    min-height: 440px;
  }

  .tool-gallery--inside {
    display: block;
    min-height: 500px;
    padding: 0;
    background:
      linear-gradient(90deg, var(--cb-navy) 0 12px, transparent 12px),
      radial-gradient(circle at 88% 8%, rgba(227, 102, 69, 0.18), transparent 23%),
      linear-gradient(145deg, #faf6ee, #eadfce);
  }

  .tool-gallery--inside::before {
    top: 20px;
    right: 20px;
    width: 40px;
    height: 4px;
  }

  .tool-gallery--inside .tool-gallery-frame {
    position: absolute;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 16px 34px rgba(38, 39, 86, 0.22);
  }

  .tool-gallery--inside .tool-gallery-frame--tall {
    z-index: 3;
    top: 68px;
    left: 50%;
    width: 76%;
    aspect-ratio: 0.73;
    transform: translateX(-50%) rotate(-1deg);
  }

  .tool-gallery--inside .tool-gallery-frame:nth-child(2) {
    z-index: 1;
    top: 28px;
    right: -10%;
    width: 58%;
    aspect-ratio: 0.68;
    transform: rotate(5deg);
  }

  .tool-gallery--inside .tool-gallery-frame:nth-child(3) {
    z-index: 2;
    bottom: 28px;
    left: -9%;
    width: 65%;
    aspect-ratio: 1.28;
    transform: rotate(-5deg);
  }

  .tool-gallery--inside .tool-gallery-frame span {
    padding: 9px 10px;
    font-size: 8px;
  }

  .tool-gallery--inside .tool-gallery-frame:nth-child(2) span,
  .tool-gallery--inside .tool-gallery-frame:nth-child(3) span {
    display: none;
  }

  .tool-gallery-frame span {
    padding: 8px 9px;
    font-size: 8px;
  }

  .tool-preview-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .tool-preview figcaption {
    padding: 12px;
    font-size: 10px;
  }

  .tool-feature {
    min-height: 420px;
    padding: 28px 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-preview img {
    transition: none;
  }
}
