/* Shared small-tool section. Tokens come from the page (:root). */

.small-tools {
  display: grid;
  grid-template-columns: minmax(13rem, 0.42fr) minmax(0, 1fr);
  gap: 2.5rem clamp(3rem, 8vw, 8rem);
  align-items: start;
  padding: clamp(3rem, 6vw, 5.5rem) 0 1rem;
  border-top: 1px solid var(--rule, #d9ddd8);
}

.tool-kicker {
  margin: 0 0 0.7rem;
  color: var(--faint, #626d7a);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.small-tools-note {
  max-width: 28ch;
  margin: 0;
  color: var(--muted, #586371);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  text-transform: none;
  text-wrap: pretty;
}

.small-tools-all {
  display: inline-block;
  margin-top: 1rem;
  color: inherit;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
  text-decoration: none;
  text-transform: none;
  border-bottom: 1px solid var(--rule, #d9ddd8);
  transition: border-color 220ms var(--ease-out, cubic-bezier(0.76, 0, 0.24, 1));
}

.small-tools-all:hover { border-bottom-color: var(--ink, #1b222b); }

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tool-grid > li {
  display: flex;
  min-width: 0;
}

.tool-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 44px;
  overflow: hidden;
  color: #1b222b;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid rgba(27, 34, 43, 0.1);
  border-radius: 14px;
  box-shadow:
    0 1px 1px rgba(27, 34, 43, 0.04),
    0 10px 28px rgba(27, 34, 43, 0.05);
  transition:
    transform 200ms var(--ease-out, cubic-bezier(0.76, 0, 0.24, 1)),
    border-color 200ms var(--ease-out, cubic-bezier(0.76, 0, 0.24, 1));
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(27, 34, 43, 0.45);
}

.tool-card:focus-visible {
  outline: 2px solid var(--focus, #2f5fa8);
  outline-offset: 4px;
}

.tool-shot-frame {
  display: block;
  overflow: hidden;
  background: #f7f7f4;
  line-height: 0;
}

.tool-shot {
  display: block;
  width: 100%;
  height: auto;
  transform: scale(1);
  transform-origin: center;
  transition: transform 200ms var(--ease-out, cubic-bezier(0.76, 0, 0.24, 1));
}

.tool-card:hover .tool-shot,
.tool-card:focus-visible .tool-shot {
  transform: scale(1.02);
}

.tool-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
  padding: 0.95rem 1.05rem 1.1rem;
  border-top: 1px solid var(--rule, #d9ddd8);
}

.tool-tags {
  color: var(--faint, #626d7a);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.tool-name {
  font-size: 1.05rem;
  font-weight: 620;
  letter-spacing: -0.018em;
  line-height: 1.3;
}

.tool-hook {
  color: #5c6166;
  font-size: 0.86rem;
  line-height: 1.45;
}

.tool-open {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  line-height: 1.2;
  border-bottom: 1px solid var(--rule, #d9ddd8);
}

.tool-open-arrow {
  display: inline-block;
  transition: transform 200ms var(--ease-out, cubic-bezier(0.76, 0, 0.24, 1));
}

.tool-card:hover .tool-open-arrow,
.tool-card:focus-visible .tool-open-arrow {
  transform: translateX(4px);
}

@media (min-width: 58rem) {
  .tool-grid[data-layout="single"] .tool-card {
    flex-direction: row;
    align-items: center;
  }

  .tool-grid[data-layout="single"] .tool-shot-frame {
    flex: 0 0 60%;
    width: 60%;
  }

  .tool-grid[data-layout="single"] .tool-body {
    border-top: 0;
    padding: 1.15rem 1.35rem 1.2rem 1.25rem;
  }

  .tool-grid[data-layout="grid"] {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 58rem) {
  .small-tools {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
}

@media (prefers-color-scheme: dark) {
  .tool-card {
    color: var(--ink, #e2e5e8);
    background: #1b2128;
    border-color: rgba(226, 229, 232, 0.14);
    box-shadow:
      0 1px 1px rgba(0, 0, 0, 0.28),
      0 12px 32px rgba(0, 0, 0, 0.32);
  }

  .tool-card:hover,
  .tool-card:focus-visible {
    border-color: rgba(226, 229, 232, 0.5);
  }

  .tool-hook { color: var(--muted, #a2abb5); }
}

@media (prefers-reduced-motion: no-preference) {
  .tool-grid > li {
    animation: tool-enter 260ms var(--ease-out, cubic-bezier(0.76, 0, 0.24, 1)) both;
  }

  .tool-grid > li:nth-child(2) { animation-delay: 90ms; }
  .tool-grid > li:nth-child(3) { animation-delay: 180ms; }
  .tool-grid > li:nth-child(4) { animation-delay: 270ms; }
  .tool-grid > li:nth-child(5) { animation-delay: 360ms; }
  .tool-grid > li:nth-child(6) { animation-delay: 450ms; }
}

@keyframes tool-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .tool-grid > li { animation: none; }

  .small-tools-all,
  .tool-card,
  .tool-shot,
  .tool-open-arrow { transition: none; }

  .tool-card:hover,
  .tool-card:focus-visible { transform: none; }

  .tool-card:hover .tool-shot,
  .tool-card:focus-visible .tool-shot { transform: none; }

  .tool-card:hover .tool-open-arrow,
  .tool-card:focus-visible .tool-open-arrow { transform: none; }
}
