/* Use Cases — Web 2.0 layout (Figma 70:1801; grid + CTAs 45:1904; filter sidebar 32:826, sub-row 32:843) */

body.page-use-cases {
  /* Same as .uce-toolbar margin-bottom — space under search row before cards */
  --uce-toolbar-to-main-gap: 36px;
  /* Fixed nav (64px) + breathing room matching toolbar→cards */
  --uce-nav-sticky-top: calc(64px + var(--uce-toolbar-to-main-gap));
  background: #d4d4d4;
  color: #0a0a0a;
  /*
   * Figma prototype spring (Smart Animate): duration 600ms, stiffness 80, damping 20, mass 1.
   * Easing curve: RK4 integration of x'' = (k(1-x) - c x') / m, sampled to CSS linear() (CSS Easing L2).
   */
  --uce-figma-spring-dur: 600ms;
  --uce-figma-spring-ease: linear(0, 0.0394 5.87%, 0.1267 11.73%, 0.2321 17.63%, 0.3382 23.5%, 0.4379 29.4%, 0.5266 35.27%, 0.6043 41.17%, 0.6704 47.03%, 0.7266 52.93%, 0.7736 58.8%, 0.813 64.7%, 0.8456 70.57%, 0.8727 76.47%, 0.895 82.33%, 0.9136 88.23%, 0.9288 94.1%, 1 100%);
  /* Older engines: overdamped spring-ish bezier */
  --uce-figma-spring-fallback: cubic-bezier(0.22, 0.99, 0.36, 1);
  /*
   * “View Use Case” arrow nudge (Figma Smart Animate): 800ms, stiffness 100, damping 15, mass 1.
   * linear() from RK4 sample of x'' = (k(1-x) - c x') / m; slight overshoot past x=1.
   */
  --uce-link-arrow-dur: 800ms;
  --uce-link-arrow-ease: linear(0, 0.1214 7.12%, 0.3608 14.28%, 0.5989 21.43%, 0.7851 28.55%, 0.9103 35.70%, 0.9826 42.85%, 1.0169 50.00%, 1.0279 57.12%, 1.0266 64.27%, 1.0204 71.42%, 1.0134 78.55%, 1.0076 85.70%, 1.0035 92.85%, 1.0010 100.00%);
  --uce-link-arrow-fallback: cubic-bezier(0.22, 1.05, 0.36, 1);
  /* Body clip collapses faster on hover-out than expand (600ms spring above). */
  --uce-card-body-collapse-dur: 380ms;
  /*
   * Figma Smart Animate: 120ms, custom spring stiffness 300, damping 100, mass 1.
   * linear() from RK4 sample of x'' = (k(1-x) - c x') / m, normalized to 1 @ 120ms.
   */
  --uce-filter-reveal-dur: 120ms;
  --uce-filter-reveal-ease: linear(0, 0.0159 5%, 0.0527 10%, 0.1008 15%, 0.1545 20%, 0.2110 25%, 0.2685 30%, 0.3261 35%, 0.3832 40%, 0.4396 45%, 0.4952 50%, 0.5499 55%, 0.6037 60%, 0.6565 65%, 0.7083 70%, 0.7592 75%, 0.8092 80%, 0.8582 85%, 0.9063 90%, 0.9536 95%, 1 100%);
  --uce-filter-reveal-fallback: cubic-bezier(0.25, 0.82, 0.25, 1);
}

/* Top banner (40px) + nav (64px) from brand.css; same gap below as toolbar→cards */
body.has-top-banner.page-use-cases {
  --uce-nav-sticky-top: calc(104px + var(--uce-toolbar-to-main-gap));
}

.page-use-cases .uce-hero {
  position: relative;
  min-height: 263px;
  padding: 71px 120px 48px;
  margin-top: 0;
  background: #f2fb90;
  /* Match .uce-card default stroke */
  border-bottom: 0.75px solid rgba(23, 23, 23, 0.5);
  overflow: hidden;
}

.page-use-cases .uce-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.page-use-cases .uce-hero-eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 12px;
  letter-spacing: 0.24px;
  text-transform: none;
  color: #0a0a0a;
  margin: 0 0 29px;
}

.page-use-cases .uce-hero h1 {
  font-family: var(--font-body);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0;
  color: #0a0a0a;
  margin: 0;
  max-width: 520px;
  text-align: left;
}

.page-use-cases .uce-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px 120px 80px;
}

.page-use-cases .uce-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: var(--uce-toolbar-to-main-gap);
  flex-wrap: wrap;
}

.page-use-cases .uce-toolbar-left {
  display: flex;
  align-items: center;
  gap: 38px;
  flex-wrap: wrap;
}

.page-use-cases .uce-count {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: #0a0a0a;
  white-space: nowrap;
}

.page-use-cases .uce-clear {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 14px;
  text-decoration: underline;
  color: #0a0a0a;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.page-use-cases .uce-clear:hover {
  opacity: 0.75;
}

.page-use-cases .uce-search {
  width: 202px;
  max-width: 100%;
  flex-shrink: 0;
  background: #f0f0f0;
  /* Same stroke as .uce-card / .uce-filter-trigger; transparent idle avoids layout shift on focus */
  border: 0.75px solid transparent;
  border-radius: 2px;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 21px;
  color: #404040;
  transition: border-color 0.15s ease;
}

.page-use-cases .uce-search:focus,
.page-use-cases .uce-search:focus-visible {
  outline: none;
  border-color: rgba(23, 23, 23, 0.5);
}

.page-use-cases .uce-search::placeholder {
  color: #404040;
}

.page-use-cases .uce-main {
  display: flex;
  align-items: flex-start;
  gap: 23px;
  min-height: 0;
}

/* Filter sidebar — Figma components 32:826 (Filter) + 32:843 (SubCategory) */
.page-use-cases .uce-filters {
  position: sticky;
  top: var(--uce-nav-sticky-top);
  align-self: flex-start;
  flex: 0 0 auto;
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  max-height: calc(100vh - var(--uce-nav-sticky-top));
  max-height: calc(100dvh - var(--uce-nav-sticky-top));
  max-height: calc(100svh - var(--uce-nav-sticky-top));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 2;
}

/* Bottom-only slack: extra scroll range when many filters are open, without shifting initial y */
.page-use-cases .uce-filters::after {
  content: '';
  display: block;
  flex-shrink: 0;
  width: 1px;
  height: 64px;
  pointer-events: none;
}

.page-use-cases .uce-filter-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* No gap when panel is collapsed (max-height 0) — avoids extra space vs “All” row */
  gap: 0;
}

.page-use-cases .uce-filter-group.is-expanded {
  gap: 16px;
}

.page-use-cases .uce-filter-trigger:focus-visible,
.page-use-cases .uce-subfilter:focus-visible {
  outline: 2px solid #0a0a0a;
  outline-offset: 2px;
}

.page-use-cases .uce-filter-trigger {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 16px 16px 14px;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 14px;
  letter-spacing: 0;
  color: #404040;
  background: transparent;
  /* Match use-case link cards: .uce-card default stroke */
  border: 0.75px solid rgba(23, 23, 23, 0.5);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.page-use-cases .uce-filter-trigger.is-active {
  background: #f0f0f0;
  border-color: transparent;
  color: #404040;
}

@media (hover: hover) and (pointer: fine) {
  .page-use-cases .uce-filter-trigger:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.1);
    /* Match use-case link cards: .uce-card hover stroke */
    border-color: rgba(23, 23, 23, 0.65);
    color: #a3a3a3;
  }

  .page-use-cases .uce-filter-trigger.is-active:hover {
    background: #e8e8e8;
    border-color: transparent;
    color: #404040;
  }
}

.page-use-cases .uce-filter-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: auto;
  max-width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
  /* Collapsed: clip content; subcategory stack gap 10px (opens to 16px) */
  gap: 10px;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-use-cases .uce-filter-group:not(.is-expanded) .uce-filter-panel {
  transition:
    max-height var(--uce-filter-reveal-dur) var(--uce-filter-reveal-ease, var(--uce-filter-reveal-fallback)),
    opacity var(--uce-filter-reveal-dur) var(--uce-filter-reveal-ease, var(--uce-filter-reveal-fallback)),
    gap var(--uce-filter-reveal-dur) var(--uce-filter-reveal-ease, var(--uce-filter-reveal-fallback)),
    visibility 0ms linear var(--uce-filter-reveal-dur);
}

.page-use-cases .uce-filter-group.is-expanded .uce-filter-panel {
  max-height: min(75vh, 1200px);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  gap: 16px;
  transition:
    max-height var(--uce-filter-reveal-dur) var(--uce-filter-reveal-ease, var(--uce-filter-reveal-fallback)),
    opacity var(--uce-filter-reveal-dur) var(--uce-filter-reveal-ease, var(--uce-filter-reveal-fallback)),
    gap var(--uce-filter-reveal-dur) var(--uce-filter-reveal-ease, var(--uce-filter-reveal-fallback)),
    visibility 0ms linear 0ms;
}

@media (prefers-reduced-motion: reduce) {
  .page-use-cases .uce-filter-group .uce-filter-panel {
    transition: none !important;
  }

  .page-use-cases .uce-filter-group.is-expanded .uce-filter-panel {
    max-height: none;
  }
}

.page-use-cases .uce-subfilter {
  box-sizing: border-box;
  display: inline-flex;
  align-items: flex-start;
  gap: 0;
  width: fit-content;
  max-width: min(260px, calc(100vw - 80px));
  margin: 0;
  padding: 16px 16px 14px;
  border: 0;
  border-radius: 2.286px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  letter-spacing: 0;
  color: #404040;
  text-align: left;
  cursor: pointer;
  transition: color 0.12s ease, gap 0.12s ease;
}

.page-use-cases .uce-subfilter-dot {
  flex: 0 0 0;
  width: 0;
  height: 6px;
  border-radius: 0;
  background: #404040;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.page-use-cases .uce-subfilter.is-active {
  gap: 10.686px;
  font-weight: 500;
}

.page-use-cases .uce-subfilter.is-active .uce-subfilter-dot {
  flex: 0 0 6px;
  width: 6px;
  opacity: 1;
  margin-top: 8px;
}

.page-use-cases .uce-subfilter-label {
  flex: 0 1 auto;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
}

@media (hover: hover) and (pointer: fine) {
  .page-use-cases .uce-subfilter:hover:not(.is-active) .uce-subfilter-label {
    text-decoration: underline;
    text-underline-offset: 2px;
  }
}

.page-use-cases .uce-grid-wrap {
  flex: 1;
  min-width: 0;
}

/*
 * Three independent columns (flex): row-major order is assigned round-robin in JS.
 * Unlike CSS Grid, row tracks are not shared—only the hovered card’s column shifts vertically.
 */
.page-use-cases .uce-grid {
  display: flex;
  align-items: flex-start;
  gap: 35px;
  width: 100%;
  min-width: 0;
}

.page-use-cases .uce-masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.page-use-cases .uce-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 257px;
  padding: 22px 14px 23px 20px;
  background: #d4d4d4;
  border: 0.75px solid rgba(23, 23, 23, 0.5);
  border-radius: 2px;
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
}

/* Use case link cards — hover / focus interaction (Figma component 20:53172) */
.page-use-cases a.uce-card {
  justify-content: flex-start;
  transition:
    background var(--uce-figma-spring-dur) var(--uce-figma-spring-ease, var(--uce-figma-spring-fallback)),
    border-color var(--uce-figma-spring-dur) var(--uce-figma-spring-ease, var(--uce-figma-spring-fallback));
}

.page-use-cases a.uce-card .uce-card-main {
  display: flex;
  flex-direction: column;
  gap: 21px;
  flex: 1 1 auto;
  min-height: 0;
  /* 64px body→link gap animates here (not on margin-top: auto ↔ px on the link). */
  padding-bottom: 0;
  box-sizing: border-box;
}

.page-use-cases a.uce-card .uce-card-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 31px;
}

.page-use-cases a.uce-card .uce-card-body {
  max-width: 244px;
  overflow: hidden;
  /* Reveal is via overflow + max-height only (no opacity fade). */
  opacity: 1;
}

.page-use-cases a.uce-card .uce-card-desc {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  letter-spacing: 0;
  color: #0a0a0a;
}

@media (hover: hover) and (pointer: fine) {
  .page-use-cases a.uce-card .uce-card-main {
    transition: padding-bottom var(--uce-figma-spring-dur) var(--uce-figma-spring-ease, var(--uce-figma-spring-fallback));
  }

  .page-use-cases a.uce-card .uce-card-body {
    max-height: 0;
    transition: max-height var(--uce-card-body-collapse-dur) var(--uce-figma-spring-ease, var(--uce-figma-spring-fallback));
  }

  .page-use-cases a.uce-card:hover,
  .page-use-cases a.uce-card:focus-within {
    background: linear-gradient(138.38deg, #d4d4d4 43.55%, #f2ff70 211.8%);
    border-color: rgba(23, 23, 23, 0.65);
  }

  /* Arrow nudge only when hovering the link row, not the whole card. */
  .page-use-cases a.uce-card .uce-card-link:hover .uce-card-link-arrow {
    transform: translateX(16px);
  }

  .page-use-cases a.uce-card:hover .uce-card-body,
  .page-use-cases a.uce-card:focus-within .uce-card-body {
    max-height: 200px;
    transition: max-height var(--uce-figma-spring-dur) var(--uce-figma-spring-ease, var(--uce-figma-spring-fallback));
  }

  /* Figma ~67px: keep ≥64px between body copy and “View Use Case” on hover (interpolates both ways). */
  .page-use-cases a.uce-card:hover .uce-card-main,
  .page-use-cases a.uce-card:focus-within .uce-card-main {
    padding-bottom: 64px;
  }
}

@media (hover: none) {
  .page-use-cases a.uce-card .uce-card-body {
    max-height: none;
    margin-top: 4px;
  }

  .page-use-cases a.uce-card .uce-card-main {
    flex: 0 1 auto;
    padding-bottom: 64px;
  }

  .page-use-cases a.uce-card .uce-card-link {
    margin-top: auto;
    transition: none;
  }

  .page-use-cases a.uce-card .uce-card-link-arrow {
    transition: none;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-use-cases a.uce-card {
    transition: border-color 0.15s ease;
  }

  .page-use-cases a.uce-card .uce-card-body {
    max-height: none;
    transition: none;
  }

  .page-use-cases a.uce-card .uce-card-main {
    flex: 0 1 auto;
    padding-bottom: 64px;
    transition: none;
  }

  .page-use-cases a.uce-card .uce-card-link {
    margin-top: auto;
    transition: none;
  }

  .page-use-cases a.uce-card .uce-card-link-arrow {
    transition: none;
    transform: none;
  }

  .page-use-cases a.uce-card .uce-card-link:hover .uce-card-link-arrow {
    transform: none;
  }
}

.page-use-cases .uce-card-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 4.8px;
  margin-bottom: 0;
  background: #f0f0f0;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 12px;
  letter-spacing: 0.24px;
  color: #404040;
}

.page-use-cases .uce-card-title {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
  color: #171717;
  margin: 0;
  max-width: min(230px, 100%);
}

.page-use-cases a.uce-card .uce-card-link {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  flex-shrink: 0;
  font-family: var(--font-head);
  font-size: 15px;
  line-height: 1;
  color: #0a0a0a;
}

.page-use-cases a.uce-card .uce-card-link-text {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-use-cases a.uce-card .uce-card-link-arrow {
  display: inline-block;
  flex-shrink: 0;
  transform: translateX(0);
  transition: transform var(--uce-link-arrow-dur) var(--uce-link-arrow-ease, var(--uce-link-arrow-fallback));
}

/* CTA card — Figma component 20:59839 (column gap 12px, padding pl 16.8 / pr 12 / pt 25 / pb 35.2) */
.page-use-cases .uce-card--cta {
  position: relative;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px;
  background: #f0f0f0;
  border: 0.5px solid #0a0a0a;
  opacity: 0.8;
  overflow: hidden;
  padding: 25px 12px 35.2px 16.8px;
  min-height: 257px;
}

.page-use-cases .uce-card--cta .uce-cta-title {
  box-sizing: border-box;
  width: 100%;
  max-width: min(277px, 100%);
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  color: #171717;
  margin: 0;
  padding: 0 6px;
}

.page-use-cases .uce-cta-btn {
  /* Figma Button node-56_18813: min width 132px, height 41, px 24, border 0.7, Button/lg 14/14 (Neue Montreal Medium) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  min-width: 132px;
  width: fit-content;
  max-width: 100%;
  min-height: 41px;
  padding: calc((41px - 0.7px * 2 - 14px) / 2) 24px;
  background: #f2ff70;
  border: 0.7px solid #0a0a0a;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 14px;
  letter-spacing: 0;
  color: #0a0a0a;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

.page-use-cases .uce-cta-btn:hover {
  filter: brightness(1.03);
}

.page-use-cases .uce-cta-btn:focus-visible {
  outline: 2px solid #0a0a0a;
  outline-offset: 2px;
}

.page-use-cases .uce-cta-art {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  transform: translate3d(0, 0, 0);
  transform-origin: 50% 88%;
  transition: transform var(--uce-figma-spring-dur) var(--uce-figma-spring-ease, var(--uce-figma-spring-fallback));
}

.page-use-cases .uce-cta-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-use-cases .uce-card--cta-mountain .uce-cta-art {
  left: -26px;
  bottom: -40px;
  width: 120%;
  height: 188px;
  /* Figma CTA 20:59839 default vs Variant2 — ~1.20 scale, drift up/left */
  transform-origin: 48% 92%;
}

.page-use-cases .uce-card--cta-knife .uce-cta-art {
  left: -10px;
  bottom: -100px;
  width: 140%;
  height: 352px;
  /* Figma CTA Variant5 vs Variant6 — ~1.11 scale, moves up */
  transform-origin: 50% 94%;
}

@media (hover: hover) and (pointer: fine) {
  .page-use-cases .uce-card--cta-mountain:hover .uce-cta-art,
  .page-use-cases .uce-card--cta-mountain:focus-within .uce-cta-art {
    transform: translate3d(-14px, -18px, 0) scale(1.2);
  }

  .page-use-cases .uce-card--cta-knife:hover .uce-cta-art,
  .page-use-cases .uce-card--cta-knife:focus-within .uce-cta-art {
    transform: translate3d(2px, -22px, 0) scale(1.11);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-use-cases .uce-cta-art {
    transition: none;
  }

  .page-use-cases .uce-card--cta-mountain:hover .uce-cta-art,
  .page-use-cases .uce-card--cta-mountain:focus-within .uce-cta-art,
  .page-use-cases .uce-card--cta-knife:hover .uce-cta-art,
  .page-use-cases .uce-card--cta-knife:focus-within .uce-cta-art {
    transform: none;
  }
}

.page-use-cases .uce-card.is-hidden {
  display: none;
}

@media (max-width: 1100px) {
  .page-use-cases .uce-grid {
    flex-direction: column;
    gap: 0;
  }

  .page-use-cases .uce-masonry-col {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .page-use-cases .uce-hero {
    padding: 48px 24px 40px;
  }

  .page-use-cases .uce-shell {
    padding: 32px 20px 60px;
  }

  .page-use-cases .uce-main {
    flex-direction: column;
  }

  .page-use-cases .uce-filters {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    flex: 1 1 auto;
  }

  .page-use-cases .uce-filter-group {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }
}
