/* Technical stack: category panels holding separate tool boxes. */
.stack-section { padding-block: clamp(72px, 10vw, 120px) 48px; }
.stack-intro { display: grid; gap: 4px; margin-bottom: 34px; }
.stack-intro .eyebrow { margin: 0 0 6px; }
.stack-intro h2 { margin: 0; font-size: clamp(38px, 6vw, 64px); line-height: 1.02; letter-spacing: -.055em; }
.stack-intro .section-description { font-size: 13px; }

.stack-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.stack-group-wide { grid-column: 1 / -1; }

.stack-group {
  min-width: 0; padding: 27px; border: 1px solid #2e2e2e; border-radius: 10px;
}
.stack-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; min-width: 0; margin-bottom: 24px; }
.stack-num { color: #666; font-size: 11px; font-variant-numeric: tabular-nums; }
.stack-group-head h3 { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: -.02em; }
.stack-group-head small { margin-left: auto; color: #656565; font-size: 8px; letter-spacing: .12em; }

.stack-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.stack-group-wide .stack-tools { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.stack-tool {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  min-width: 0; min-height: 96px; padding: 18px 7px; border: 1px solid #2c2c2c; border-radius: 6px;
  background: none; text-align: center;
  transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}
.stack-tool span { max-width: 100%; color: #9a9a9a; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; transition: color .25s ease; }
.stack-tool img, .stack-tool svg { display: block; width: 28px; height: 28px; object-fit: contain; }
/* Black single-colour marks are flipped to white; dark navy ones are lifted. */
.stack-tool img.invert { filter: invert(1); }
.stack-tool img.lift { filter: brightness(2.4) saturate(1.3); }
/* Line icons take a colour per category so every box has some colour. */
.stack-tool svg { --tint: #7c8cf0; fill: none; stroke: var(--tint); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.stack-group:nth-child(3) .stack-tool svg { --tint: #4cc7a0; }
.stack-group:nth-child(4) .stack-tool svg { --tint: #d07ae6; }
.stack-group:nth-child(5) .stack-tool svg { --tint: #f0a35c; }
.stack-group:nth-child(8) .stack-tool svg { --tint: #ef6b6b; }
.stack-tool:hover { border-color: #777; transform: translateY(-4px); }
.stack-tool:hover span { color: #f2f2f2; }

#stack { scroll-margin-top: 110px; }

@media (max-width: 860px) {
  .stack-groups { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stack-group { padding: 20px; }
  .stack-group-head h3 { font-size: 17px; }
  .stack-group-head small { width: 100%; margin-left: 23px; }
  .stack-tools, .stack-group-wide .stack-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stack-tool { min-height: 100px; padding: 16px 5px; }
  #stack { scroll-margin-top: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  .stack-tool:hover { transform: none; }
}
