/* ------------------------------------------------------------------
   Applications page (frontend/pages/applications.blade.php).
   Intro with live-count bento, industry index cards, a sticky industry
   switcher, alternating industry sections (leaf-shaped media, uses list,
   linked products) and a closing CTA. Uses the site's color variables
   and leaf-corner shape throughout.
-------------------------------------------------------------------- */

/* ---------- Shared bits ---------- */
.apps-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px 6px 6px;
  margin-bottom: 18px;
  border: 1px dashed color-mix(in srgb, var(--accent-color), transparent 45%);
  border-radius: 30px;
  color: var(--heading-color);
  font-size: 0.9rem;
  font-weight: 600;
}

.apps-badge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--heading-color);
  color: #fff;
  font-size: 13px;
}

.apps-title {
  margin-bottom: 18px;
  font-size: calc(2.6rem * var(--type-display-scale, 1));
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.apps-title .accent-highlight {
  color: var(--accent-color);
}

.apps-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.apps-btn i {
  font-size: 1.1em;
  transition: transform 0.25s ease;
}

.apps-btn:hover {
  transform: translateY(-2px);
}

.apps-btn:hover i {
  transform: translate(2px, -2px);
}

.apps-btn-dark {
  background: var(--heading-color);
  color: #fff;
}

.apps-btn-dark:hover {
  background: var(--accent-color);
  color: var(--contrast-color);
}

.apps-btn-ghost {
  border-color: color-mix(in srgb, var(--heading-color), transparent 75%);
  color: var(--heading-color);
}

.apps-btn-ghost:hover {
  border-color: var(--heading-color);
  color: var(--heading-color);
}

.apps-btn-accent {
  background: var(--accent-color);
  color: var(--contrast-color);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent-color), transparent 70%);
}

.apps-btn-accent:hover {
  background: var(--heading-color);
  color: #fff;
}

.apps-btn-light {
  background: #fff;
  color: var(--heading-color);
}

.apps-btn-light:hover {
  background: var(--accent-color);
  color: var(--contrast-color);
}

.apps-btn-outline-light {
  border-color: rgb(255 255 255 / 0.45);
  color: #fff;
}

.apps-btn-outline-light:hover {
  border-color: #fff;
  color: #fff;
}

/* ---------- Intro ---------- */
.apps-intro-text {
  max-width: 560px;
  margin-bottom: 30px;
  color: color-mix(in srgb, var(--default-color), transparent 18%);
  font-size: 1.05rem;
  line-height: 1.75;
}

.apps-intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.apps-bento {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 18px;
}

.apps-bento-tile {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 150px;
  padding: 26px 28px;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 91%);
  border-radius: 36px 10px 36px 10px;
  background: var(--surface-color);
  box-shadow: 0 14px 36px color-mix(in srgb, var(--heading-color), transparent 94%);
}

.apps-bento-main {
  grid-row: span 2;
  position: relative;
  overflow: hidden;
  justify-content: space-between;
  border: 0;
  border-radius: 52px 14px 52px 14px;
  background: linear-gradient(155deg, var(--heading-color), color-mix(in srgb, var(--heading-color), var(--accent-color) 45%));
  color: #fff;
  isolation: isolate;
}

.apps-bento-main::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-color), transparent 55%);
  filter: blur(60px);
}

.apps-bento-accent {
  border: 0;
  background: color-mix(in srgb, var(--accent-color), transparent 86%);
}

.apps-bento-number {
  display: block;
  color: var(--heading-color);
  font-family: var(--heading-font);
  font-size: calc(3.2rem * var(--type-display-scale, 1));
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.apps-bento-main .apps-bento-number {
  color: #fff;
  font-size: calc(5rem * var(--type-display-scale, 1));
}

.apps-bento-label {
  display: block;
  margin-top: 8px;
  color: color-mix(in srgb, var(--default-color), transparent 25%);
  font-size: 0.9rem;
  font-weight: 600;
}

.apps-bento-main .apps-bento-label {
  color: rgb(255 255 255 / 0.78);
  font-size: 1rem;
}

.apps-bento-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.apps-bento-icons span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 14px 4px 14px 4px;
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  font-size: 1.05rem;
}

/* ---------- Industry index ---------- */
.apps-index-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

/* Four per row on desktop, with a short last row centred. */
.apps-index-grid > * {
  flex: 1 1 250px;
  max-width: calc((100% - 60px) / 4);
}

@media (max-width: 1199px) {
  .apps-index-grid > * {
    max-width: calc((100% - 40px) / 3);
  }
}

@media (max-width: 767px) {
  .apps-index-grid > * {
    max-width: calc((100% - 20px) / 2);
  }
}

@media (max-width: 519px) {
  .apps-index-grid > * {
    max-width: none;
  }
}

.apps-index-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 26px 24px 22px;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 91%);
  border-radius: 36px 10px 36px 10px;
  background: var(--surface-color);
  color: var(--default-color);
  transition: transform 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.apps-index-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.apps-index-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px 6px 18px 6px;
  background: color-mix(in srgb, var(--accent-color), transparent 88%);
  color: var(--accent-color);
  font-size: 1.4rem;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* Industry photo, used instead of the icon row when an image is set */
.apps-index-photo {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  margin: -10px -8px 18px;
  overflow: hidden;
  border-radius: 28px 8px 28px 8px;
  background: color-mix(in srgb, var(--accent-color), transparent 88%);
}

.apps-index-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.apps-index-card:hover .apps-index-photo img {
  transform: scale(1.06);
}

.apps-index-photo-number {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 11px;
  border-radius: 12px 4px 12px 4px;
  background: rgb(255 255 255 / 0.92);
  color: var(--heading-color);
  font-family: var(--heading-font);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

.apps-index-number {
  color: color-mix(in srgb, var(--heading-color), transparent 80%);
  font-family: var(--heading-font);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  transition: color 0.35s ease;
}

.apps-index-name {
  margin-bottom: 8px;
  color: var(--heading-color);
  font-family: var(--heading-font);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.3;
  transition: color 0.35s ease;
}

.apps-index-summary {
  flex-grow: 1;
  margin-bottom: 18px;
  color: color-mix(in srgb, var(--default-color), transparent 25%);
  font-size: 0.88rem;
  line-height: 1.6;
  transition: color 0.35s ease;
}

.apps-index-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-color);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.35s ease;
}

.apps-index-more i {
  transition: transform 0.35s ease;
}

.apps-index-card:hover {
  transform: translateY(-6px);
  border-color: transparent;
  background: var(--heading-color);
  box-shadow: 0 24px 48px color-mix(in srgb, var(--heading-color), transparent 78%);
}

.apps-index-card:hover .apps-index-icon {
  background: var(--accent-color);
  color: var(--contrast-color);
}

.apps-index-card:hover .apps-index-number {
  color: rgb(255 255 255 / 0.25);
}

.apps-index-card:hover .apps-index-name {
  color: #fff;
}

.apps-index-card:hover .apps-index-summary {
  color: rgb(255 255 255 / 0.72);
}

.apps-index-card:hover .apps-index-more {
  color: #fff;
}

.apps-index-card:hover .apps-index-more i {
  transform: translateX(4px);
}

/* ---------- Sticky industry switcher ---------- */
.apps-nav {
  position: sticky;
  top: var(--apps-nav-top, 100px);
  z-index: 990;
  padding: 10px 0;
  pointer-events: none;
}

.apps-nav-track {
  display: flex;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid rgb(255 255 255 / 0.7);
  border-radius: 50px;
  background: rgb(255 255 255 / 0.86);
  box-shadow: 0 14px 40px color-mix(in srgb, var(--heading-color), transparent 86%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  scrollbar-width: none;
  pointer-events: auto;
}

.apps-nav-track::-webkit-scrollbar {
  display: none;
}

/* When the chips don't all fit, fade the edge that has more to scroll to. */
.apps-nav-track.can-scroll-right {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
}

.apps-nav-track.can-scroll-left {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 56px), transparent);
}

.apps-nav-track.can-scroll-left.can-scroll-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
}

.apps-nav-link {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 50px;
  color: var(--heading-color);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.apps-nav-link i {
  color: var(--accent-color);
  transition: color 0.25s ease;
}

.apps-nav-link:hover {
  background: color-mix(in srgb, var(--accent-color), transparent 88%);
  color: var(--heading-color);
}

.apps-nav-link.is-active {
  background: var(--heading-color);
  color: #fff;
}

.apps-nav-link.is-active i {
  color: #fff;
}

/* ---------- Industry sections ---------- */
.apps-industry {
  scroll-margin-top: 170px;
}

.apps-media {
  position: relative;
  aspect-ratio: 4 / 4.2;
  overflow: hidden;
  border-radius: 64px 16px 64px 16px;
  background: linear-gradient(150deg, var(--heading-color), color-mix(in srgb, var(--heading-color), var(--accent-color) 55%));
  box-shadow: 0 30px 60px color-mix(in srgb, var(--heading-color), transparent 80%);
  isolation: isolate;
}

.apps-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.apps-media:hover img {
  transform: scale(1.04);
}

/* Designed stand-in when an industry has no photo yet. */
.apps-media-pattern {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(rgb(255 255 255 / 0.14) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000 10%, transparent 75%);
  mask-image: radial-gradient(circle at 70% 30%, #000 10%, transparent 75%);
}

.apps-media-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  color: #fff;
  font-size: clamp(5rem, 11vw, 8.5rem);
  line-height: 1;
  opacity: 0.92;
  transform: translate(-50%, -62%);
  filter: drop-shadow(0 18px 30px rgb(0 0 0 / 0.25));
}

.apps-media-name {
  position: absolute;
  top: 34px;
  left: 38px;
  right: 38px;
  color: rgb(255 255 255 / 0.55);
  font-family: var(--heading-font);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.apps-media-badge {
  position: absolute;
  bottom: 26px;
  left: 26px;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 20px 6px 20px 6px;
  background: rgb(255 255 255 / 0.92);
  color: var(--heading-color);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.apps-media-badge strong {
  font-family: var(--heading-font);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
}

.apps-media-badge span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.apps-industry-step {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent-color);
  font-family: var(--heading-font);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.apps-industry-step span {
  color: color-mix(in srgb, var(--default-color), transparent 55%);
}

.apps-industry-title {
  margin-bottom: 14px;
  font-size: calc(2.4rem * var(--type-display-scale, 1));
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.apps-industry-summary {
  margin-bottom: 14px;
  color: var(--heading-color);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.55;
}

.apps-industry-text {
  margin-bottom: 26px;
  color: color-mix(in srgb, var(--default-color), transparent 18%);
  line-height: 1.8;
}

.apps-subheading {
  margin: 0 0 14px;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.apps-uses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.apps-uses li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 91%);
  border-radius: 16px 5px 16px 5px;
  background: var(--surface-color);
  color: var(--heading-color);
  font-size: 0.93rem;
  font-weight: 600;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.apps-uses li:hover {
  transform: translateX(4px);
  border-color: color-mix(in srgb, var(--accent-color), transparent 55%);
}

.apps-uses li i {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-color);
  color: var(--contrast-color);
  font-size: 0.85rem;
}

.apps-products {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.apps-product {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 6px;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 88%);
  border-radius: 50px;
  background: var(--surface-color);
  color: var(--heading-color);
  font-size: 0.9rem;
  font-weight: 700;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.apps-product img,
.apps-product-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.apps-product-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent-color), transparent 88%);
  color: var(--accent-color);
}

.apps-product > i {
  color: var(--accent-color);
  transition: transform 0.25s ease;
}

.apps-product:hover {
  border-color: var(--accent-color);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--heading-color), transparent 88%);
  color: var(--heading-color);
}

.apps-product:hover > i {
  transform: translate(2px, -2px);
}

/* ---------- Closing CTA ---------- */
.apps-cta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 56px 60px;
  overflow: hidden;
  border-radius: 72px 18px 72px 18px;
  background: linear-gradient(135deg, var(--heading-color), color-mix(in srgb, var(--heading-color), var(--accent-color) 40%));
  color: #fff;
  isolation: isolate;
}

.apps-cta-glow {
  position: absolute;
  z-index: -1;
  right: -80px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-color), transparent 45%);
  filter: blur(90px);
}

.apps-cta-copy {
  flex: 1 1 420px;
  max-width: 640px;
}

.apps-cta h2 {
  margin-bottom: 12px;
  color: #fff;
  font-size: calc(2.2rem * var(--type-display-scale, 1));
  font-weight: 800;
  line-height: 1.2;
}

.apps-cta p {
  margin: 0;
  color: rgb(255 255 255 / 0.78);
  line-height: 1.7;
}

.apps-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .apps-media {
    max-width: 520px;
    aspect-ratio: 16 / 12;
    margin: 0 auto;
  }

  .apps-industry {
    scroll-margin-top: 140px;
  }
}

@media (max-width: 575px) {
  .apps-bento {
    grid-template-columns: 1fr 1fr;
  }

  .apps-bento-main {
    grid-column: span 2;
    grid-row: auto;
  }

  .apps-bento-tile {
    min-height: 0;
    padding: 22px;
  }

  .apps-uses {
    grid-template-columns: 1fr;
  }

  .apps-cta {
    padding: 40px 26px;
    border-radius: 48px 14px 48px 14px;
  }

  .apps-cta-actions,
  .apps-cta-actions .apps-btn {
    width: 100%;
    justify-content: center;
  }

  .apps-nav-link {
    padding: 8px 14px;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .apps-btn,
  .apps-index-card,
  .apps-uses li,
  .apps-media img,
  .apps-index-photo img {
    transition: none;
  }

  .apps-btn:hover,
  .apps-index-card:hover,
  .apps-uses li:hover,
  .apps-media:hover img {
    transform: none;
  }
}
