/* Design Lab / Pattern Library — real, responsive previews with restrained motion.
   Scope: gallery cards only. Every SVG has a complete, useful static state. */

.gallery-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 42px;
  align-items: stretch;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d9dfdc;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 34px rgb(21 34 27 / 5%);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .25s ease, box-shadow .3s ease;
}

.gallery-card:hover, .gallery-card:focus-within {
  transform: translateY(-4px);
  border-color: #a9bdb1;
  box-shadow: 0 21px 45px rgb(21 34 27 / 10%);
}

.gallery-thumb {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(156px, 1fr);
  align-content: stretch;
  gap: 15px;
  aspect-ratio: auto;
  min-width: 0;
  min-height: 332px;
  padding: 23px 24px 22px;
  overflow: hidden;
  position: relative;
}

.gallery-thumb .thumb-eyebrow {
  display: block;
  font-size: 10px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: .115em;
  text-transform: uppercase;
  opacity: 1;
}

.gallery-thumb .thumb-title {
  display: block;
  margin: 0;
  align-self: start;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(29px, 2.32vw, 40px);
  font-weight: 760;
  line-height: 1.015;
  letter-spacing: -.07em;
}

.gallery-thumb.editorial {
  color: #1f2d26;
  background: #eff2ed;
}
.gallery-thumb.editorial .thumb-eyebrow { color: #314839; }
.gallery-thumb.editorial .thumb-title { color: #203027; }
.gallery-thumb.editorial .thumb-title em {
  color: #829b8d;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.065em;
}

.gallery-thumb.cinematic {
  color: #f3f7f5;
  background: #111920;
}
.gallery-thumb.cinematic .thumb-eyebrow { color: #dfebef; }
.gallery-thumb.cinematic .thumb-title { color: #f2f6f5; }
.gallery-thumb.cinematic .thumb-title span { color: #9aaeb8; }

.gallery-thumb.automation {
  color: #1a344e;
  background: #eaf1fa;
}
.gallery-thumb.automation .thumb-eyebrow { color: #28405d; }
.gallery-thumb.automation .thumb-title { color: #1b364f; }
.gallery-thumb.automation .thumb-title span { color: #386bd8; }

.thumb-preview {
  display: block;
  position: relative;
  z-index: 1;
  align-self: stretch;
  min-width: 0;
  min-height: 156px;
  width: 100%;
  overflow: hidden;
  border: 1px solid #ced9d1;
  border-radius: 12px;
  background: #fbfdf9;
  box-shadow: 0 7px 17px rgb(24 39 30 / 7%);
}

.thumb-preview svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
}

.gallery-thumb.cinematic .thumb-preview {
  border-color: #415562;
  background: #19242e;
  box-shadow: 0 8px 19px rgb(0 0 0 / 18%);
}

.gallery-thumb.automation .thumb-preview {
  border-color: #b9cce5;
  background: #f5f9ff;
  box-shadow: 0 7px 17px rgb(40 91 163 / 9%);
}

.gallery-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 24px 25px 26px;
  border-top: 1px solid #e6ebe8;
  background: #fff;
  color: #1b2425;
}

.gallery-card-body .topline {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  color: #667671;
  text-transform: uppercase;
}

.gallery-card h2 {
  margin: 9px 0 11px;
  color: #192224;
  font-size: clamp(21px, 1.75vw, 25px);
  font-weight: 740;
  line-height: 1.12;
  letter-spacing: -.055em;
}

.gallery-card p {
  min-height: 0;
  margin: 0 0 24px;
  color: #65716d;
  font-size: 13px;
  line-height: 1.58;
  font-weight: 400;
}

.gallery-card .inline-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: auto;
  color: #1f2a27;
  font-size: 12px;
  font-weight: 750;
  text-underline-offset: 5px;
}

.gallery-card .inline-link:focus-visible {
  border-radius: 3px;
  outline: 3px solid #427f62;
  outline-offset: 5px;
}

/* Lightweight SVG-only microinteraction: no transforms on card layout. */
@media (prefers-reduced-motion: no-preference) {
  .pattern-svg .ed-headline {
    animation: ed-line 6.4s ease-in-out infinite;
  }
  .pattern-svg .ed-support {
    animation: ed-line 6.4s ease-in-out -0.6s infinite;
  }
  .pattern-svg .ed-cta {
    animation: ed-button 6.4s ease-in-out infinite;
  }
  .pattern-svg .ed-orbit {
    transform-box: fill-box;
    transform-origin: center;
    animation: ed-orbit 6.4s ease-in-out infinite;
  }
  .pattern-svg .ed-scan {
    animation: ed-scan 6.4s ease-in-out infinite;
  }

  .pattern-svg .cin-caret {
    animation: cin-caret 1.1s steps(1,end) infinite;
  }
  .pattern-svg .cin-flowline {
    animation: cin-dash 7.2s linear infinite;
  }
  .pattern-svg .cin-node {
    transform-box: fill-box;
    transform-origin: center;
    animation: cin-node 5.4s ease-in-out infinite;
  }
  .pattern-svg .cin-node--2 { animation-delay: -3.6s; }
  .pattern-svg .cin-node--3 { animation-delay: -1.8s; }
  .pattern-svg .cin-status {
    animation: cin-status 5.4s ease-in-out infinite;
  }

  .pattern-svg .flow-signal {
    animation: flow-travel 5.8s linear infinite;
  }
  .pattern-svg .flow-signal--bottom { animation-delay: -2.9s; }
  .pattern-svg .flow-dot {
    transform-box: fill-box;
    transform-origin: center;
    animation: flow-dot 5.8s ease-in-out infinite;
  }
  .pattern-svg .flow-dot--bottom { animation-delay: -2.9s; }

  .gallery-card:hover .pattern-svg .ed-scan,
  .gallery-card:hover .pattern-svg .flow-signal {
    animation-duration: 3.4s;
  }
}

@keyframes ed-line {
  0%, 8%, 85%, 100% { opacity: 1; transform: translateX(0); }
  38%, 46% { opacity: .65; transform: translateX(5px); }
}
@keyframes ed-button {
  0%, 30%, 70%, 100% { fill: #486d56; }
  43%, 54% { fill: #70a27e; }
}
@keyframes ed-orbit {
  0%, 14%, 75%, 100% { transform: scale(1); }
  38%, 48% { transform: scale(1.075); }
}
@keyframes ed-scan {
  0%, 10% { opacity: 0; transform: translateY(0); }
  23% { opacity: .7; }
  52% { opacity: .65; transform: translateY(63px); }
  61%, 100% { opacity: 0; transform: translateY(63px); }
}
@keyframes cin-caret {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}
@keyframes cin-dash {
  to { stroke-dashoffset: -80; }
}
@keyframes cin-node {
  0%, 18%, 38%, 100% { transform: scale(1); filter: none; }
  25%, 32% { transform: scale(1.15); filter: brightness(1.4); }
}
@keyframes cin-status {
  0%, 35%, 65%, 100% { fill: #31564e; }
  46%, 57% { fill: #4d8872; }
}
@keyframes flow-travel {
  from { stroke-dashoffset: 244; }
  to { stroke-dashoffset: 0; }
}
@keyframes flow-dot {
  0%, 18%, 38%, 100% { opacity: 1; transform: scale(1); }
  24%, 32% { opacity: .75; transform: scale(1.28); }
}

@media (max-width: 940px) {
  .gallery-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-thumb { min-height: 324px; }
  .gallery-thumb .thumb-title { font-size: clamp(29px, 4vw, 38px); }
}
@media (max-width: 620px) {
  .gallery-cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin-top: 32px;
  }
  .gallery-thumb {
    min-height: 308px;
    padding: 21px 22px 21px;
  }
  .gallery-thumb .thumb-title { font-size: clamp(30px, 8vw, 37px); }
  .gallery-card-body { padding: 22px; }
  .thumb-preview { min-height: 148px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .pattern-svg * {
    animation: none !important;
    transition: none !important;
  }
  .gallery-card:hover,
  .gallery-card:focus-within { transform: none; }
}
