.home-tools-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0 0 28px;
  padding: 26px;
  border: 1px solid #dce6ef;
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(40, 121, 185, .12), transparent 34%),
    linear-gradient(145deg, #fbfdff 0%, #f4f8fc 100%);
  box-shadow: 0 18px 42px rgba(31, 53, 70, .09);
}

.home-tools-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(230px, .8fr);
  align-items: end;
  gap: 28px;
}

.home-tools-heading h1 {
  max-width: 760px;
  margin: .08em 0 0;
  font-size: clamp(2rem, 3.7vw, 3.15rem);
}

.home-tools-heading p {
  margin: 0 0 5px;
  color: #526575;
  font-size: 1rem;
  line-height: 1.55;
}

.home-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.home-tool-card {
  --tool-accent: #356fda;
  --tool-soft: #edf4ff;
  --tool-border: #cdddf9;
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 8px 12px;
  min-height: 142px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid var(--tool-border);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--tool-soft), #fff 78%);
  color: #263746;
  text-decoration: none;
  box-shadow: 0 7px 18px rgba(31, 53, 70, .06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.home-tool-card::after {
  position: absolute;
  right: -24px;
  bottom: -28px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--tool-accent);
  content: "";
  opacity: .08;
}

.home-tool-card:hover {
  color: #263746;
  border-color: var(--tool-accent);
  box-shadow: 0 13px 28px rgba(31, 53, 70, .13);
  transform: translateY(-3px);
}

.home-tool-card:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.home-tool-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: var(--tool-accent);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--tool-accent) 25%, transparent);
}

.home-tool-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.home-tool-copy {
  min-width: 0;
}

.home-tool-copy strong,
.home-tool-copy small {
  display: block;
}

.home-tool-copy strong {
  color: #263746;
  font-size: 1rem;
  line-height: 1.3;
}

.home-tool-copy small {
  margin-top: 3px;
  color: #526575;
  font-size: .84rem;
  line-height: 1.38;
}

.home-tool-action {
  z-index: 1;
  grid-column: 1 / -1;
  align-self: end;
  color: var(--tool-accent);
  font-size: .83rem;
  font-weight: 800;
  line-height: 1.25;
}

.home-tool-action span {
  display: inline-block;
  margin-left: 3px;
  transition: transform .18s ease;
}

.home-tool-card:hover .home-tool-action span {
  transform: translateX(3px);
}

.tool-resume { --tool-accent: #6847c7; --tool-soft: #f2efff; --tool-border: #d9d0fa; }
.tool-letter { --tool-accent: #1673c8; --tool-soft: #edf7ff; --tool-border: #cce4f8; }
.tool-invoice { --tool-accent: #d66617; --tool-soft: #fff5e9; --tool-border: #f5d6b4; }
.tool-certificate { --tool-accent: #0d8a72; --tool-soft: #eafaf5; --tool-border: #bde5d9; }
.tool-gatepass { --tool-accent: #c73d69; --tool-soft: #fff0f5; --tool-border: #f2cada; }
.tool-letterhead { --tool-accent: #a86d00; --tool-soft: #fff8dc; --tool-border: #ecdca3; }

.home-tools-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 17px 2px 0;
  color: #526575;
  font-size: .88rem;
}

.home-tools-note span {
  white-space: nowrap;
}

.typing-tutor-promo-wrap {
  container-type: inline-size;
  margin: 0 0 28px;
}

.typing-tutor-promo {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(210px, 270px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  overflow: hidden;
  padding: 20px 22px;
  border: 1px solid #cdddf3;
  border-radius: 21px;
  background:
    radial-gradient(circle at 90% 0, rgba(124, 58, 237, .15), transparent 36%),
    linear-gradient(120deg, #eef7ff, #f7f2ff);
  box-shadow: 0 14px 34px rgba(30, 64, 175, .1);
}

.typing-tutor-promo::after {
  position: absolute;
  right: 13%;
  bottom: -64px;
  z-index: -1;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(13, 148, 136, .11);
  content: "";
}

.typing-tutor-promo-logo {
  display: block;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .9);
  text-decoration: none;
}

.typing-tutor-promo-logo img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 0;
}

.typing-tutor-promo-copy {
  min-width: 0;
}

.typing-tutor-promo-copy h2 {
  margin: 0;
  color: #17233b;
  font-size: clamp(1.4rem, 2.3vw, 1.85rem);
  line-height: 1.2;
}

.typing-tutor-promo-features {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.typing-tutor-promo-features span {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid rgba(37, 99, 235, .17);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  color: #34445c;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.typing-tutor-promo-action {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  background: #243b5a;
  color: #fff;
  font-size: .94rem;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(36, 59, 90, .2);
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.typing-tutor-promo-action:hover {
  color: #fff;
  background: #1769ff;
  box-shadow: 0 13px 26px rgba(23, 105, 255, .24);
  transform: translateY(-2px);
}

.typing-tutor-promo-action span {
  font-size: 1.05rem;
}

@media (max-width: 1100px) {
  .typing-tutor-promo {
    grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
  }

  .typing-tutor-promo-action {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 620px) {
  .typing-tutor-promo {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 18px;
    border-radius: 18px;
  }

  .typing-tutor-promo-logo {
    width: min(100%, 270px);
  }

  .typing-tutor-promo-action {
    grid-column: auto;
  }
}

@container (max-width: 780px) {
  .typing-tutor-promo {
    grid-template-columns: minmax(200px, 270px) minmax(0, 1fr);
  }

  .typing-tutor-promo-action {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@container (max-width: 600px) {
  .typing-tutor-promo {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 18px;
    border-radius: 18px;
  }

  .typing-tutor-promo-logo {
    width: min(100%, 270px);
  }

  .typing-tutor-promo-action {
    grid-column: auto;
  }
}

@container (max-width: 390px) {
  .typing-tutor-promo-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .typing-tutor-promo-features span {
    justify-content: center;
    white-space: normal;
  }
}

@media (max-width: 900px) {
  .home-tools-heading {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .home-tools-heading p {
    max-width: 720px;
  }

  .home-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .home-tools-hero {
    margin-inline: -6px;
    padding: 20px;
    border-radius: 20px;
  }

  .home-tools-heading h1 {
    font-size: clamp(1.9rem, 9vw, 2.45rem);
  }

  .home-tool-grid {
    grid-auto-columns: minmax(238px, 82vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    margin-right: -20px;
    padding: 2px 20px 12px 1px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
  }

  .home-tool-card {
    min-height: 140px;
    scroll-snap-align: start;
  }

  .home-tools-note {
    gap: 7px 14px;
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-tool-card,
  .home-tool-action span,
  .typing-tutor-promo-action {
    transition: none;
  }
}
