/* Article links in the homepage Tools section; other project cards keep their layout. */
#tools {
  --tool-card-duration: 220ms;
  --tool-card-ease: cubic-bezier(.22, 1, .36, 1);
}
:root {
  --learn-shift: 2px;
  --learn-spread: 8deg;
  --learn-in: 350ms;
  --learn-out: 350ms;
  --learn-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
.t-learn-chevron {
  display: inline-flex;
  transform: translateX(0);
  transition: transform var(--learn-out) var(--learn-ease);
}
.t-learn-arm {
  transform-box: view-box;
  transform-origin: 10px 8px;
  vector-effect: non-scaling-stroke;
  transition: transform var(--learn-out) var(--learn-ease);
}
.t-learn:hover .t-learn-chevron { transform: translateX(var(--learn-shift)); transition-duration: var(--learn-in); }
.t-learn:hover .t-learn-arm { transition-duration: var(--learn-in); }
.t-learn:hover .t-learn-arm-top { transform: rotate(var(--learn-spread)); }
.t-learn:hover .t-learn-arm-bot { transform: rotate(calc(var(--learn-spread) * -1)); }

@media (prefers-reduced-motion: reduce) {
  .t-learn-chevron, .t-learn-arm { transition: none !important; }
}
#tools .wip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
#tools .tool-article-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 1px solid #c6dfef;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 76, 112, .08);
  overflow: visible;
  transition: transform var(--tool-card-duration) var(--tool-card-ease),
    box-shadow var(--tool-card-duration) var(--tool-card-ease),
    border-color var(--tool-card-duration) var(--tool-card-ease);
}
#tools .tool-article-card::before { content: none; }
#tools .tool-article-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 22px;
  border-radius: 20px;
  color: #253746;
  text-decoration: none;
  cursor: pointer;
}
#tools .tool-article-link .wip-thumb {
  aspect-ratio: 16 / 10;
  margin: -22px -22px 20px;
  border-radius: 19px 19px 0 0;
  background: #eaf4fb;
  overflow: hidden;
}
/* Keep the whole tool artwork visible, including when the global reveal hook runs. */
#tools .tool-article-link .wip-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  clip-path: none;
  transform: none;
  opacity: 1;
}
#tools .tool-article-link .wip-cat { color: #516777; font-size: 11px; letter-spacing: .12em; }
#tools .tool-article-link .wip-name { color: #253746; font-size: 19px; line-height: 1.5; }
#tools .tool-article-link .wip-desc { color: #526675; font-family: var(--font-body); font-size: 14px; line-height: 1.85; }
#tools .tool-article-link .wip-status {
  align-self: flex-start;
  margin-bottom: 18px;
  color: #245b75;
  background: #e7f4fb;
  font-size: 11px;
}
#tools .tool-article-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-top: auto;
  padding: 11px 16px;
  border-radius: 10px;
  background: #147bc1;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  transition: background-color var(--tool-card-duration) var(--tool-card-ease);
}
#tools .tool-article-arrow {
  display: inline-block;
  font-family: sans-serif;
  font-size: 23px;
  line-height: 1;
}
#tools .tool-article-link:focus-visible { outline: 3px solid #126fb0; outline-offset: 4px; }
#tools .tool-article-link:focus-visible .tool-article-cta { background: #075d98; }
#tools .tool-article-link:active .tool-article-cta { background: #075d98; }
#tools .tool-article-card > .wip-read { margin: 0 22px 22px; color: #253746; }
@media (hover: hover) and (pointer: fine) {
  #tools .tool-article-card:hover {
    transform: translateY(-4px);
    border-color: #65b3e6;
    box-shadow: var(--motion-edge-glow, 0 0 24px rgba(94,170,255,.24));
  }
  #tools .tool-article-link:hover .tool-article-cta { background: #075d98; }
}
@media (hover: none), (pointer: coarse) {
  #tools .t-learn-chevron, #tools .t-learn-arm { transform: none; transition: none; }
}
@media (max-width: 900px) {
  #tools .wip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  #tools .wip-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  #tools .tool-article-card,
  #tools .tool-article-cta,
  #tools .tool-article-arrow { transition: none; }
  #tools .tool-article-card:hover,
  #tools .tool-article-link:hover .tool-article-arrow,
  #tools .tool-article-link:hover .t-learn-arm { transform: none; }
}

#tools .tool-article-link:not(a), #wip .tool-article-link:not(a) { cursor:default; }
