/* Homepage "Software Solutions & Digital Innovation" section.
   Markup: resources/views/partials/software-solutions.blade.php. Everything is scoped to .ss. */

.ss {
  --ss-navy: #0b1535;
  --ss-royal: #0055f5;
  --ss-ice: #e3effd;
  --ss-gold: #ffa500;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(48px, 4vw, 76px) 0 clamp(88px, 7.4vw, 140px);
  color: var(--ss-navy);
  font-family: var(--font-cn, "Figtree", "Plus Jakarta Sans", system-ui, sans-serif);
}

/* ---------- Background (soft shapes + layered waves) ---------- */
.ss-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 42%, #f1f7ff 100%);
}
.ss-bg svg { position: absolute; display: block; }
.ss-blob-tl { left: 0; top: 0; width: clamp(240px, 30vw, 580px); height: clamp(130px, 15vw, 300px); }
.ss-blob-tr { right: 0; top: 0; width: clamp(150px, 17vw, 330px); height: clamp(110px, 12.5vw, 250px); }
.ss-waves { left: 0; bottom: 0; width: 100%; height: clamp(96px, 11vw, 220px); }

/* ---------- Layout ---------- */
.ss-wrap {
  position: relative;
  width: calc(100% - 88px);
  max-width: var(--max, 1640px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto auto 1fr;
  grid-template-areas: "stage ." "stage head" "stage body" "stage .";
  column-gap: clamp(28px, 3.2vw, 72px);
}
.ss-head { grid-area: head; }
.ss-body { grid-area: body; }

/* ---------- Device showcase: three separate images, layered ---------- */
.ss-stage {
  grid-area: stage;
  position: relative;
  align-self: center;
  aspect-ratio: 1145 / 720;
}
.ss-dev { position: absolute; margin: 0; }
.ss-dev img { display: block; width: 100%; height: auto; }
.ss-laptop { z-index: 1; width: 88%; left: 11%; top: 1%; }
.ss-tablet { z-index: 2; width: 29.5%; left: 0; bottom: 4%; --ss-amp: -5px; }
.ss-phone  { z-index: 3; width: 17.5%; left: 21.5%; bottom: 0; --ss-amp: -7px; }

/* ---------- Copy ---------- */
.ss-kicker {
  display: inline-block;
  margin: 0;
  padding: .5em 1.15em;
  border-radius: 999px;
  background: var(--ss-ice);
  color: var(--ss-navy);
  font-size: clamp(13px, .88vw, 16.5px);
  font-weight: 700;
  line-height: 1.25;
}
.ss-kicker span { margin: 0 .12em; }
.ss-title {
  margin: clamp(14px, 1.3vw, 24px) 0 0;
  color: var(--ss-navy);
  font-family: inherit;
  font-size: clamp(32px, 3vw, 58px);
  font-weight: 800;
  line-height: 1.17;
  letter-spacing: -.025em;
}
.ss-line { display: block; white-space: nowrap; }
.ss-accent { color: var(--ss-royal); }
.ss-rule {
  display: block;
  width: 76px;
  height: 5px;
  margin-top: clamp(16px, 1.25vw, 24px);
  border-radius: 99px;
  background: var(--ss-gold);
}
.ss-desc {
  max-width: 560px;
  margin: clamp(16px, 1.5vw, 28px) 0 0;
  color: #27324d;
  font-size: clamp(15.5px, 1vw, 19px);
  font-weight: 500;
  line-height: 1.6;
}

/* ---------- Service cards ---------- */
.ss-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: clamp(22px, 2.1vw, 40px) 0 0;
  padding: 0;
  list-style: none;
}
.ss-cards > li { display: flex; }
.ss-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 24px rgba(28, 86, 180, .08), 0 0 0 1px rgba(214, 228, 248, .75);
  transition: transform .3s ease, box-shadow .3s ease;
}
.ss-card svg { flex: none; width: 34px; height: 34px; color: var(--ss-royal); transition: transform .3s ease; }
.ss-card span { color: var(--ss-navy); font-size: clamp(14px, .86vw, 16.5px); font-weight: 800; line-height: 1.25; }
.ss-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(28, 86, 180, .14), 0 0 0 1px rgba(196, 216, 246, .95); }
.ss-card:hover svg { transform: scale(1.05); }

/* ---------- CTA ---------- */
.ss-cta-row { display: flex; justify-content: center; margin-top: clamp(24px, 2.3vw, 44px); }
.ss-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 296px;
  height: 58px;
  padding: 0 34px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0875ff 0%, #0045e5 100%);
  color: #fff;
  font-size: clamp(16px, 1vw, 18px);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(0, 69, 229, .26);
  transition: box-shadow .3s ease, transform .2s ease, filter .3s ease;
}
.ss-cta i { font-size: 1.15em; transition: transform .25s ease; }
.ss-cta:hover { color: #fff; filter: saturate(1.15) brightness(1.07); box-shadow: 0 16px 32px rgba(0, 69, 229, .36); }
.ss-cta:hover i { transform: translateX(4px); }
.ss-cta:active { transform: scale(.97); }
.ss-cta:focus-visible { outline: 3px solid var(--ss-gold); outline-offset: 3px; color: #fff; }

/* ---------- Motion (only when the section script is running) ---------- */
.ss.ss-js .ss-dev {
  opacity: 0;
  transition: opacity .8s cubic-bezier(.22, .61, .36, 1), transform .8s cubic-bezier(.22, .61, .36, 1);
}
.ss.ss-js .ss-laptop { transform: translate3d(0, 20px, 0); }
.ss.ss-js .ss-tablet { transform: translate3d(-36px, 0, 0); transition-delay: .15s; }
.ss.ss-js .ss-phone  { transform: translate3d(0, 34px, 0); transition-delay: .3s; }
.ss.ss-js .ss-stage.is-in .ss-dev { opacity: 1; transform: none; }

/* idle float: tablet and phone only, different speed and phase; the laptop stays still */
.ss-tablet img { animation: ss-float 6s ease-in-out 1.2s infinite; }
.ss-phone img  { animation: ss-float 5s ease-in-out 2.1s infinite; }
.ss.ss-js .ss-stage:not(.is-active) .ss-dev img { animation-play-state: paused; }
@keyframes ss-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, var(--ss-amp, -5px), 0); }
}

.ss.ss-js .ss-rv {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity .6s ease, transform .6s cubic-bezier(.22, .61, .36, 1);
  transition-delay: calc(var(--i, 0) * 90ms + 120ms);
}
.ss.ss-js .is-in .ss-rv { opacity: 1; transform: none; }

/* ---------- Laptop / small desktop ---------- */
@media (max-width: 1400px) {
  .ss-wrap { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .ss-card { gap: 11px; padding: 11px 14px; border-radius: 16px; }
  .ss-card svg { width: 30px; height: 30px; }
}
@media (max-width: 1180px) {
  .ss-wrap { width: calc(100% - 64px); }
}

/* ---------- Tablet: stacked (copy, devices, cards) ---------- */
@media (max-width: 1100px) {
  .ss-wrap {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "head" "stage" "body";
  }
  .ss-head { max-width: 720px; margin-inline: auto; text-align: center; }
  .ss-title { font-size: clamp(30px, 4.4vw, 42px); }
  .ss-rule, .ss-desc { margin-inline: auto; }
  .ss-stage { width: min(100%, 820px); margin: clamp(26px, 4vw, 44px) auto 0; }
  .ss-body { width: min(100%, 640px); margin: clamp(22px, 3.6vw, 40px) auto 0; }
  .ss-cards { margin-top: 0; }
  .ss-blob-tr { display: none; }
}

/* ---------- Phone ---------- */
@media (max-width: 620px) {
  .ss { padding: 44px 0 84px; }
  .ss-wrap { width: calc(100% - 32px); }
  .ss-kicker { font-size: 12.5px; }
  .ss-title { font-size: clamp(27px, 7.6vw, 34px); }
  .ss-desc { font-size: 15px; }
  .ss-cards { gap: 12px; }
  .ss-card { gap: 10px; min-height: 64px; padding: 10px 12px; border-radius: 15px; }
  .ss-card svg { width: 26px; height: 26px; }
  .ss-card span { font-size: 13.5px; }
  .ss-cta { width: 100%; max-width: 340px; min-width: 0; height: 54px; font-size: 16px; }
  .ss-waves { height: 72px; opacity: .8; }
  .ss-blob-tl { opacity: .7; }
  /* gentler motion on small screens */
  .ss-tablet { --ss-amp: -3px; }
  .ss-phone  { --ss-amp: -4px; }
  .ss.ss-js .ss-tablet { transform: translate3d(-18px, 0, 0); }
  .ss.ss-js .ss-phone  { transform: translate3d(0, 18px, 0); }
}
@media (max-width: 400px) {
  .ss-line { white-space: normal; }
}
@media (max-width: 359px) {
  .ss-cards { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Reduced motion: everything visible, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  .ss.ss-js .ss-dev, .ss.ss-js .ss-rv { opacity: 1; transform: none; transition: none; }
  .ss-dev img { animation: none; }
  .ss-card, .ss-card svg, .ss-cta, .ss-cta i { transition: none; }
  .ss-card:hover, .ss-card:hover svg, .ss-cta:hover i, .ss-cta:active { transform: none; }
}
