/* 08 — Where LegacyBridge fits (Figma desktop 712:9014 @1920 / mobile 353:2544) */
.industries {
  background: var(--surface-white);
  font-family: var(--font);
  overflow: hidden;
}
.industries__inner {
  max-width: var(--container-w);
  margin: 0 auto;
  box-sizing: border-box;
  padding: var(--section-pad) 0 var(--section-pad) var(--page-pad);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 48px;
}

/* header */
.industries__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}
.industries__title {
  margin: 0;
  font: 500 54px/58px var(--font);
  letter-spacing: -2.16px;
  color: var(--brand-primary);
  white-space: nowrap;
}

/* cards row — 8 cards × 350px, overflows to the right like the Figma frame */
.industries__grid {
  list-style: none;
  margin: 0;
  padding: 0 var(--page-pad) 0 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  gap: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-top: 14px; padding-bottom: 14px; margin-top: -14px; margin-bottom: -14px; /* room for the hover scale */
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* bleed to both viewport edges so scrolled cards are never clipped at the container */
  --edge: 0px;
  width: 100vw;
  margin-left: calc(-1 * var(--edge) - var(--page-pad));
  padding-left: calc(var(--edge) + var(--page-pad));
  scroll-padding-left: calc(var(--edge) + var(--page-pad));
}
.industries__grid::-webkit-scrollbar { display: none; }

.industries__card {
  flex: 0 0 372px;
  width: 372px;
  min-height: 333px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--surface-section);
  border-radius: var(--radius-12);
  overflow: hidden;
}
.industries__strip {
  width: 100%;
  height: 40px;
  flex-shrink: 0;
}
.industries__strip--subtle { background: var(--surface-subtle); }
.industries__strip--primary { background: var(--brand-primary); }
.industries__strip--accent { background: var(--brand-accent); }

.industries__body {
  flex: 1 0 auto;
  width: 100%;
  box-sizing: border-box;
  margin-top: -16px; /* body overlaps the strip by 16px with rounded top corners */
  border-radius: var(--radius-12) var(--radius-12) 0 0;
  position: relative;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  overflow: hidden;
}
.industries__card--section .industries__body { background: var(--surface-section); }
.industries__card--card .industries__body { background: var(--surface-card); }

.industries__chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  flex-shrink: 0;
}
.industries__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: block;
}
.industries__icon img,
.industries__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
/* hover: the card lifts slightly and its icon plays a little plot (movement only — no colour change) */
.industries__card { transition: transform .5s cubic-bezier(.16, 1, .3, 1); will-change: transform; }
.industries__card:hover { transform: scale(1.03); }
.industries__chip { transition: transform .5s cubic-bezier(.16, 1, .3, 1), background-color .35s ease; }
.industries__card:hover .industries__chip { transform: scale(1.08); background: var(--brand-accent); }
.industries__svg { overflow: visible; }
.industries__svg * { transform-box: fill-box; transform-origin: center; }
.industries__svg .ind-puff, .industries__svg .ind-speed path, .industries__svg .ind-crate,
.industries__svg .ind-drop, .industries__svg .ind-roll { opacity: 0; }

.industries__spacer {
  display: block;
  width: 100%;
  height: 48px;
  flex-shrink: 0;
}
.industries__name {
  margin: 0;
  width: 100%;
  font: 500 20px/24px var(--font);
  letter-spacing: -0.4px;
  color: var(--text-ink);
  white-space: normal; /* long names (Custom AS/400 (IBM i) applications) wrap instead of being clipped */
  text-wrap: balance;
}
/* a card with its own page links to it: the name is the link, stretched over the card body */
.industries__link { color: inherit; text-decoration: none; }
.industries__link::after { content: ""; position: absolute; inset: 0; }
.industries__link:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 4px; }
.industries__card:hover .industries__link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.industries__rule {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--border-divider);
  flex-shrink: 0;
}
.industries__desc {
  margin: 0;
  width: 100%;
  font: 400 14px/18px var(--font);
  letter-spacing: -0.56px;
  color: var(--text-muted);
  word-break: break-word;
}

@media (max-width: 767px) {
  .industries__inner {
    padding: 64px 0 64px 16px;
    gap: 24px;
  }
  .industries__head {
    width: 100%;
    gap: 12px;
  }
  .industries__title {
    font-size: 32px;
    line-height: 36px;
    letter-spacing: -0.96px;
    white-space: normal;
  }
  .industries__grid {
    gap: 16px;
    padding-right: 16px;
  }
  /* Card / Industry 727:2 — fixed 280 × 327 on mobile */
  .industries__card {
    flex-basis: 280px;
    width: 280px;
    min-height: 0;
    height: 327px;
  }
  .industries__body { padding: 24px; }
  .industries__name {
    font-size: 20px;
    line-height: 24px;
    letter-spacing: -0.4px;
  }
}

/* ---------- icon plots (only while the card is hovered) ---------- */
/* 1 factory: three smoke puffs rise from the chimney */
.industries__card:hover .ind-puff { animation: ind-puff 2.4s ease-out infinite; }
.industries__card:hover .ind-puff-2 { animation-delay: .8s; }
.industries__card:hover .ind-puff-3 { animation-delay: 1.6s; }
@keyframes ind-puff {
  0%   { opacity: 0;   transform: translate(0, 2px) scale(.5); }
  15%  { opacity: .8; }
  60%  { opacity: .35; }
  100% { opacity: 0;   transform: translate(3px, -11px) scale(1.25); }
}
/* 2 truck: drives off with a bump, speed lines stream behind */
.industries__card:hover .ind-truck { animation: ind-drive 1.4s ease-in-out infinite; }
.industries__card:hover .ind-speed path { animation: ind-speed .9s linear infinite; }
.industries__card:hover .ind-speed-2 { animation-delay: .3s; }
.industries__card:hover .ind-speed-3 { animation-delay: .6s; }
@keyframes ind-drive {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(2px, -.8px); }
  50%      { transform: translate(3px, .3px); }
  75%      { transform: translate(1.5px, -.5px); }
}
@keyframes ind-speed {
  0%   { opacity: 0;  transform: translateX(6px); }
  30%  { opacity: .7; }
  100% { opacity: 0;  transform: translateX(-6px); }
}
/* 3 warehouse: the shutter lifts, a crate rolls in through the door */
.industries__card:hover .ind-shutter { animation: ind-shutter 2.6s ease-in-out infinite; }
.industries__card:hover .ind-crate { animation: ind-crate 2.6s ease-in-out infinite; }
@keyframes ind-shutter {
  0%, 15%  { transform: translateY(0); }
  35%, 80% { transform: translateY(-4px); }
  100%     { transform: translateY(0); }
}
@keyframes ind-crate {
  0%, 30%  { opacity: 0;  transform: translateX(0); }
  40%      { opacity: 1; }
  70%, 78% { opacity: 1;  transform: translateX(18px); }
  86%      { opacity: 0;  transform: translateX(18px); }
  100%     { opacity: 0;  transform: translateX(0); }
}
/* 4 umbrella: rocks in the gusts while rain streaks past */
.industries__card:hover .ind-umbrella { transform-origin: 20px 30px; animation: ind-rock 2.2s ease-in-out infinite; }
.industries__card:hover .ind-drop { animation: ind-drop 1.1s linear infinite; }
.industries__card:hover .ind-drop-2 { animation-delay: .35s; }
.industries__card:hover .ind-drop-3 { animation-delay: .7s; }
.industries__card:hover .ind-drop-4 { animation-delay: .2s; }
@keyframes ind-rock {
  0%, 100% { transform: rotate(-5deg); }
  50%      { transform: rotate(5deg); }
}
@keyframes ind-drop {
  0%   { opacity: 0;  transform: translateY(-10px); }
  25%  { opacity: .7; }
  100% { opacity: 0;  transform: translateY(8px); }
}
/* 5 bank: a coin rolls along the base from left to right, slows down and fades — money passing through the bank */
.industries__card:hover .ind-roll { animation: ind-roll 2.4s cubic-bezier(.2, .6, .4, 1) infinite; }
.industries__card:hover .ind-spin { animation: ind-spin 2.4s cubic-bezier(.2, .6, .4, 1) infinite; }
@keyframes ind-roll {
  0%       { opacity: 0; transform: translateX(0); }
  10%      { opacity: 1; }
  78%      { opacity: 1; transform: translateX(30px); }
  92%,100% { opacity: 0; transform: translateX(31px); }
}
@keyframes ind-spin {
  0%   { transform: rotate(0deg); }
  78%  { transform: rotate(430deg); }
  100% { transform: rotate(445deg); }
}
/* 6 first-aid: the cross beats like a pulse, the kit hops with it */
.industries__card:hover .ind-cross { animation: ind-beat 1.6s ease-in-out infinite; }
.industries__card:hover .ind-kit { animation: ind-hop 1.6s ease-in-out infinite; }
@keyframes ind-beat {
  0%, 100% { transform: scale(1); }
  14%      { transform: scale(1.3); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.22); }
  56%      { transform: scale(1); }
}
@keyframes ind-hop {
  0%, 100% { transform: translateY(0); }
  14%      { transform: translateY(-1px); }
  42%      { transform: translateY(-.6px); }
}
/* 7 storefront: a gust ripples the awning scallop by scallop */
.industries__card:hover .ind-scallop { animation: ind-ripple 1.5s ease-in-out infinite; }
.industries__card:hover .ind-scallop-2 { animation-delay: .15s; }
.industries__card:hover .ind-scallop-3 { animation-delay: .3s; }
@keyframes ind-ripple {
  0%, 100% { transform: translateY(0) scaleY(1); }
  30%      { transform: translateY(1.2px) scaleY(1.18); }
  60%      { transform: translateY(-.4px) scaleY(.94); }
}
/* 8 terminal: the prompt nudges and a command types itself on the line */
.industries__card:hover .ind-prompt { animation: ind-nudge 1.8s ease-in-out infinite; }
.industries__svg .ind-cmd { stroke-dasharray: 1; stroke-dashoffset: 0; }
.industries__card:hover .ind-cmd { animation: ind-type 1.8s steps(6, end) infinite; }
@keyframes ind-nudge {
  0%, 100% { transform: translateX(0); }
  10%      { transform: translateX(1.4px); }
  20%      { transform: translateX(0); }
}
@keyframes ind-type {
  0%, 12%  { stroke-dashoffset: 1; }
  70%, 88% { stroke-dashoffset: 0; }
  100%     { stroke-dashoffset: 1; }
}
@media (prefers-reduced-motion: reduce) { .industries__card:hover .industries__svg * { animation: none !important; } }
