/* ══════════════════════════════════════════════════════════════════════
 * HOW IT WORKS: skewed gradient cards (vanilla port of 21st.dev
 * gradient-card-showcase), toned to sit with the rest of the site:
 * light page background, white cards with the site's border and shadow,
 * blue-family gradient panels at reduced strength, a soft glow.
 * Rest: a skewed gradient panel (plus blurred glow) behind a white text card.
 * Open (hover, or scrolled to the middle of the screen on touch devices):
 * the panel straightens and widens, the card slides left and grows, two
 * frosted tiles float out. Only the open card animates.
 * ══════════════════════════════════════════════════════════════════════ */
.hiw { position: relative; overflow: hidden; }
.hiw .wrap { position: relative; }

.hiw__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px 30px;
}
.hiw__card {
  position: relative;
  width: clamp(270px, 28vw, 330px);
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hiw__card.reveal:nth-child(2) { transition-delay: 0.08s; }
.hiw__card.reveal:nth-child(3) { transition-delay: 0.16s; }

/* gradient panels */
.hiw__panel {
  position: absolute;
  top: 0;
  left: 50px;
  width: 50%;
  height: 100%;
  border-radius: 14px;
  background: linear-gradient(315deg, var(--g1), var(--g2));
  opacity: 0.85;
  transform: skewX(15deg);
  transition: transform 0.5s ease, left 0.5s ease, width 0.5s ease, opacity 0.5s ease;
}
.hiw__panel--glow { filter: blur(34px); opacity: 0.3; }

/* frosted tiles */
.hiw__chips { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hiw__chips i {
  position: absolute;
  width: 0;
  height: 0;
  border-radius: 12px;
  opacity: 0;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 20px -10px rgba(21, 32, 59, 0.25);
  /* both tiles pop out together, on the same timing as the panel and card
   * (transform is left to the float animation, so the two never fight) */
  transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease, top 0.5s ease, left 0.5s ease, right 0.5s ease, bottom 0.5s ease;
  animation: hiwFloat 2.4s ease-in-out infinite paused;
}
.hiw__chips i:first-child { top: 0; left: 0; }
.hiw__chips i:last-child { bottom: 0; right: 0; animation-delay: -1.2s; }
@keyframes hiwFloat {
  0%, 100% { transform: translateY(6px); }
  50% { transform: translateY(-6px); }
}

/* text card: same look as the site's other cards */
.hiw__body {
  position: relative;
  z-index: 2;
  left: 0;
  padding: 28px 30px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: left 0.5s ease, padding 0.5s ease, box-shadow 0.5s ease;
}
.hiw__num {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  /* same soft glow as the pricing cards' free-build pill */
  box-shadow: inset 0 0 0 1px rgba(21, 32, 59, 0.06), 0 0 0 3px rgba(216, 250, 112, 0.18), 0 6px 16px -6px rgba(160, 210, 30, 0.45);
  font: 700 14px/1 var(--display);
  margin-bottom: 22px;
}
.hiw__body h3 { font-size: 20px; line-height: 1.25; margin-bottom: 10px; }
.hiw__body p { font-size: 15.5px; color: var(--muted); }

/* open state: scrolled to the middle of the screen on touch devices (is-on),
 * or hovered with a real mouse. Touch screens get no :hover rules at all, since
 * phones keep a tapped card "hovered" and it would stay stuck open. */
.hiw__card.is-on .hiw__panel { transform: skewX(0deg); left: 20px; width: calc(100% - 90px); opacity: 1; }
.hiw__card.is-on .hiw__panel--glow { opacity: 0.4; }
.hiw__card.is-on .hiw__body { left: -25px; padding: 48px 30px; box-shadow: 0 1px 2px rgba(21,32,59,.06), 0 24px 48px -20px rgba(21,32,59,.28); }
.hiw__card.is-on .hiw__chips i { width: 84px; height: 84px; opacity: 1; animation-play-state: running; }
.hiw__card.is-on .hiw__chips i:first-child { top: -42px; left: 50px; }
.hiw__card.is-on .hiw__chips i:last-child { bottom: -42px; right: 50px; }
@media (hover: hover) and (pointer: fine) {
  .hiw__card:hover .hiw__panel { transform: skewX(0deg); left: 20px; width: calc(100% - 90px); opacity: 1; }
  .hiw__card:hover .hiw__panel--glow { opacity: 0.4; }
  .hiw__card:hover .hiw__body { left: -25px; padding: 48px 30px; box-shadow: 0 1px 2px rgba(21,32,59,.06), 0 24px 48px -20px rgba(21,32,59,.28); }
  .hiw__card:hover .hiw__chips i { width: 84px; height: 84px; opacity: 1; animation-play-state: running; }
  .hiw__card:hover .hiw__chips i:first-child { top: -42px; left: 50px; }
  .hiw__card:hover .hiw__chips i:last-child { bottom: -42px; right: 50px; }
}

@media (max-width: 640px) {
  .hiw__list { gap: 56px; }
  .hiw__card { width: min(320px, calc(100% - 24px)); height: 350px; }
  .hiw__body { padding: 24px 24px; }
  .hiw__card.is-on .hiw__body { left: -12px; padding: 40px 24px; }
  .hiw__card.is-on .hiw__chips i { width: 70px; height: 70px; }
  .hiw__card.is-on .hiw__chips i:first-child { top: -35px; }
  .hiw__card.is-on .hiw__chips i:last-child { bottom: -35px; }
}
@media (max-width: 640px) and (hover: hover) and (pointer: fine) {
  .hiw__card:hover .hiw__body { left: -12px; padding: 40px 24px; }
  .hiw__card:hover .hiw__chips i { width: 70px; height: 70px; }
  .hiw__card:hover .hiw__chips i:first-child { top: -35px; }
  .hiw__card:hover .hiw__chips i:last-child { bottom: -35px; }
}
