/* Process — kinfe123/bento (Farm UI) · vanilla adaptation for NLMedia staging */
/* Visual source: https://21st.dev/@kinfe123/components/bento */

[data-section="process"][data-process-variant="bento"] {
  position: relative;
  --bento-glass-border: rgba(255, 255, 255, 0.13);
  --bento-glass-highlight: rgba(255, 255, 255, 0.22);
  --bento-glass-bg: linear-gradient(
    148deg,
    rgba(255, 255, 255, 0.09) 0%,
    rgba(255, 255, 255, 0.025) 18%,
    rgba(18, 20, 24, 0.78) 52%,
    rgba(10, 11, 14, 0.9) 100%
  );
  --bento-glass-shadow:
    inset 0 1px 0 var(--bento-glass-highlight),
    inset 1px 0 0 rgba(255, 255, 255, 0.05),
    inset 0 -12px 28px rgba(0, 0, 0, 0.46),
    0 14px 36px rgba(0, 0, 0, 0.48);
  --bento-glass-blur: 12px;
  --bento-glass-radius: 1.25rem;
  --bento-scene-inset-y: 9%;
  --bento-scene-inset-x: 11%;
}

[data-section="process"][data-process-variant="bento"] > h2 {
  margin-bottom: var(--space-6);
}

[data-bento-process] {
  margin: 0 0 var(--space-6);
}

[data-bento-grid] {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
}

[data-bento-card] {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateZ(0);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    inset 0 -20px 80px -20px rgba(120, 124, 132, 0.07);
}

[data-bento-visual] {
  position: relative;
  height: clamp(14rem, 34vw, 22rem);
  flex-shrink: 0;
  overflow: hidden;
}

[data-bento-bg] {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Unified restrained liquid-glass surfaces (Step 01–05) */
[data-bento-glass-surface] {
  position: relative;
  isolation: isolate;
  background: var(--bento-glass-bg);
  border: 1px solid var(--bento-glass-border);
  box-shadow: var(--bento-glass-shadow);
}

[data-bento-glass-surface]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    152deg,
    rgba(255, 255, 255, 0.13) 0%,
    rgba(255, 255, 255, 0.03) 24%,
    transparent 50%
  );
  pointer-events: none;
  z-index: 0;
}

[data-bento-glass-stage] {
  position: absolute;
  inset: var(--bento-scene-inset-y) var(--bento-scene-inset-x) calc(var(--bento-scene-inset-y) + 2%) var(--bento-scene-inset-x);
  border-radius: var(--bento-glass-radius);
  overflow: hidden;
}

[data-bento-glass-stage] [data-bento-bg] {
  background-color: #08090b;
}

[data-bento-card][data-bento-pos="3"] [data-bento-glass-stage] [data-bento-bg] {
  top: -22%;
  left: -48%;
  background-size: contain;
}

[data-bento-card][data-bento-pos="4"] [data-bento-glass-stage] [data-bento-bg] {
  top: -32%;
  left: -48%;
  background-size: contain;
}

[data-bento-caption] {
  position: relative;
  z-index: 2;
  isolation: isolate;
  margin-top: -5rem;
  min-height: 9.5rem;
  padding: clamp(1rem, 2.8vw, 1.65rem) clamp(1rem, 3vw, 1.75rem);
  color: #fff;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.55) 45%,
    rgba(0, 0, 0, 0.72) 100%
  );
}

[data-bento-label] {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
}

[data-bento-title] {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #fff;
}

[data-bento-title] span {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
  font-size: 0.85em;
}

/* Desktop bento grid — lg:grid-cols-6 lg:grid-rows-2 */
@media (min-width: 1024px) {
  [data-bento-grid] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  [data-bento-card][data-bento-pos="1"] {
    border-top-left-radius: 2rem;
  }

  [data-bento-card][data-bento-pos="2"] {
    border-top-right-radius: 2rem;
  }

  [data-bento-card][data-bento-pos="3"] {
    border-bottom-left-radius: 2rem;
  }

  [data-bento-card][data-bento-pos="4"] {
    border-bottom-right-radius: 2rem;
  }
}

/* Mobile stacked — rounded top/bottom like original max-lg */
@media (max-width: 1023px) {
  [data-bento-visual] {
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  }

  [data-bento-card]:hover [data-bento-visual],
  [data-bento-card]:focus-within [data-bento-visual] {
    transform: scale(1.02);
  }

  [data-bento-card][data-bento-pos="1"] {
    border-top-left-radius: 2rem;
    border-top-right-radius: 2rem;
  }

  [data-bento-card][data-bento-pos="4"] {
    border-bottom-left-radius: 2rem;
    border-bottom-right-radius: 2rem;
  }

  [data-bento-card][data-bento-pos="3"] [data-bento-glass-stage] [data-bento-bg] {
    top: -18%;
    left: -42%;
  }

  [data-bento-card][data-bento-pos="4"] [data-bento-glass-stage] [data-bento-bg] {
    top: -28%;
    left: -42%;
  }
}

/* Phone-only bento: one lead step, then two compact pairs. */
@media (max-width: 720px) {
  [data-bento-grid] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    align-items: stretch;
  }

  [data-bento-card] {
    min-width: 0;
    min-height: 11.5rem;
    border-radius: 0.75rem;
  }

  [data-bento-card][data-bento-pos="1"] {
    border-radius: 0.75rem;
  }

  [data-bento-card] [data-bento-visual] {
    height: 7.5rem;
  }



  [data-bento-card] [data-bento-caption] {
    min-height: 5.25rem;
    margin-top: -1.25rem;
    padding: 0.65rem 0.7rem;
  }



  [data-bento-card] [data-bento-label] {
    font-size: 0.6875rem;
  }

  [data-bento-card] [data-bento-title] {
    margin-top: 0.25rem;
    font-size: 1rem;
    line-height: 1.16;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: auto;
  }



  [data-bento-card][data-bento-pos="3"] [data-bento-glass-stage] [data-bento-bg],
  [data-bento-card][data-bento-pos="4"] [data-bento-glass-stage] [data-bento-bg] {
    top: 0;
    left: 0;
    background-position: center;
    background-size: cover;
  }
}

@media (max-width: 360px) {
  [data-bento-grid] {
    gap: 0.375rem;
  }

  [data-bento-card] [data-bento-caption] {
    padding-inline: 0.55rem;
  }
}

@media (max-width: 720px) and (hover: none), (max-width: 720px) and (pointer: coarse) {
  [data-bento-card]:hover [data-bento-visual],
  [data-bento-card]:focus-within [data-bento-visual] {
    transform: none;
  }
}

[data-cta="process-start"] {
  color: var(--muted);
  margin-bottom: var(--space-4);
}

[data-cta="process-start"] a {
  color: var(--fg);
}

[data-section="process"][data-process-variant="bento"] > p:last-of-type {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

@media (prefers-reduced-motion: reduce) {
  [data-bento-visual] {
    transition: none !important;
  }

  [data-bento-card] {
    opacity: 1 !important;
    transform: none !important;
  }

  [data-bento-scene],
  [data-bento-plate],
  [data-bento-chat-bubble],
  [data-bento-route-svg],
  [data-bento-glass-stage] {
    animation: none !important;
  }
}

/* --- Step 01 / 02: reference objects (safe inset, no clipping) --- */

[data-bento-art] {
  position: absolute;
  inset: 0;
  background: #050505;
}

[data-bento-scene] {
  position: absolute;
  inset: var(--bento-scene-inset-y) var(--bento-scene-inset-x) calc(var(--bento-scene-inset-y) + 2%) var(--bento-scene-inset-x);
  transform-origin: center center;
}

[data-bento-ambient] {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 68%;
  height: 68%;
  margin: -34% 0 0 -34%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 44% 36%,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(200, 205, 212, 0.035) 34%,
    transparent 70%
  );
  filter: blur(16px);
  pointer-events: none;
}

[data-bento-plate] {
  position: absolute;
  inset: 0;
  border-radius: var(--bento-glass-radius);
  animation: bento-plate-float 9s ease-in-out infinite;
}

[data-bento-plate-bg] {
  position: absolute;
  inset: 9%;
  border-radius: calc(var(--bento-glass-radius) - 0.2rem);
  opacity: 0.58;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 24%, rgba(255, 255, 255, 0.06) 0%, transparent 40%),
    repeating-linear-gradient(
      -32deg,
      transparent 0 10px,
      rgba(255, 255, 255, 0.026) 10px 11px
    ),
    repeating-linear-gradient(
      58deg,
      transparent 0 14px,
      rgba(255, 255, 255, 0.02) 14px 15px
    );
  pointer-events: none;
}

[data-bento-plate-bg]::before,
[data-bento-plate-bg]::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.22);
}

[data-bento-plate-bg]::before {
  left: 24%;
  top: 30%;
}

[data-bento-plate-bg]::after {
  right: 20%;
  bottom: 26%;
}

@keyframes bento-plate-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -3px, 0);
  }
}

/* Step 01 — chat bubble + check tile */
[data-bento-chat-wrap] {
  position: absolute;
  inset: 11% 10% 11% 10%;
  z-index: 1;
}

[data-bento-chat-bubble] {
  position: absolute;
  left: 26%;
  top: 14%;
  width: 64%;
  height: 54%;
  z-index: 1;
  border-radius: 1.05rem;
}

[data-bento-chat-bubble]::after {
  content: "";
  position: absolute;
  right: 12%;
  bottom: -5%;
  width: 13%;
  height: 16%;
  background: linear-gradient(162deg, rgba(88, 92, 100, 0.55) 0%, rgba(24, 26, 30, 0.78) 100%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-top: none;
  border-left: none;
  clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 68%);
  box-shadow: 1px 3px 8px rgba(0, 0, 0, 0.42);
}

[data-bento-chat-lines] {
  position: absolute;
  left: 16%;
  top: 30%;
  width: 68%;
  display: flex;
  flex-direction: column;
  gap: 0.44rem;
  z-index: 1;
}

[data-bento-chat-lines] span {
  display: block;
  height: 0.26rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(8, 9, 11, 0.9) 0%, rgba(22, 24, 28, 0.85) 100%);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.78),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

[data-bento-chat-lines] span:nth-child(1) {
  width: 66%;
}

[data-bento-chat-lines] span:nth-child(2) {
  width: 82%;
}

[data-bento-chat-lines] span:nth-child(3) {
  width: 50%;
}

[data-bento-chat-check] {
  position: absolute;
  left: 6%;
  bottom: 8%;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 0.78rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20%;
}

[data-bento-chat-check] svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.2));
  z-index: 1;
}

/* Step 02 — strategy path + side stack */
[data-bento-route-svg] {
  position: absolute;
  left: 12%;
  top: 18%;
  width: 52%;
  height: auto;
  z-index: 1;
  opacity: 0.97;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.48));
}

[data-bento-side-stack] {
  position: absolute;
  right: 4%;
  top: 14%;
  width: 28%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 2;
}

[data-bento-mini-tile] {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24%;
}

[data-bento-mini-tile] svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.16));
  z-index: 1;
}

[data-bento-card][data-bento-pos="1"] [data-bento-visual],
[data-bento-card][data-bento-pos="2"] [data-bento-visual] {
  background: radial-gradient(
    ellipse 78% 68% at 50% 44%,
    rgba(255, 255, 255, 0.035) 0%,
    transparent 68%
  );
}

@media (max-width: 1023px) {
  [data-section="process"][data-process-variant="bento"] {
    --bento-scene-inset-y: 10%;
    --bento-scene-inset-x: 12%;
  }

  [data-bento-chat-bubble] {
    left: 24%;
    top: 13%;
    width: 66%;
    height: 53%;
  }

  [data-bento-chat-check] {
    left: 5%;
    bottom: 7%;
    width: 27%;
  }

  [data-bento-route-svg] {
    left: 10%;
    top: 17%;
    width: 54%;
  }

  [data-bento-side-stack] {
    right: 5%;
    top: 13%;
    width: 29%;
    gap: 0.36rem;
  }
}

@media (max-width: 1023px) and (prefers-reduced-motion: no-preference) {
  [data-bento-card][data-bento-pos="1"]:hover [data-bento-scene],
  [data-bento-card][data-bento-pos="2"]:hover [data-bento-scene] {
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    transform: scale(1.015);
  }
}

/* --- Desktop PC: stable hover + opaque layers (no footer bleed) --- */
@media (min-width: 1024px) {
  [data-section="process"][data-process-variant="bento"] {
    position: relative;
    z-index: 1;
    isolation: isolate;
    background: var(--bg, #000);
  }

  [data-bento-process] {
    contain: paint;
  }

  [data-bento-card]:hover,
  [data-bento-card]:focus-within {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.2),
      inset 0 -20px 80px -20px rgba(120, 124, 132, 0.1),
      0 0 0 1px rgba(255, 255, 255, 0.06);
  }

  [data-bento-card]:hover [data-bento-visual],
  [data-bento-card]:focus-within [data-bento-visual] {
    transform: none;
  }

  [data-bento-glass-surface] {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  [data-bento-caption] {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: linear-gradient(
      180deg,
      rgba(4, 4, 5, 0.94) 0%,
      rgba(0, 0, 0, 0.97) 45%,
      rgba(0, 0, 0, 0.99) 100%
    );
  }
}


/* — PC-only compact: whole block ~20% smaller (2026-09-14) — */
@media (min-width: 1024px) {
  [data-section="process"][data-process-variant="bento"] {
    padding-block: calc(var(--section-y) * 0.8);
  }

  [data-bento-grid] {
    gap: 0.8rem;
    margin-top: clamp(1.4rem, 3.2vw, 2.2rem);
  }

  [data-bento-card] {
    min-height: 0;
  }

  [data-bento-visual] {
    height: clamp(11.2rem, 27.2vw, 17.6rem);
  }

  [data-bento-caption] {
    min-height: 7.6rem;
    padding: clamp(1rem, 2.4vw, 1.45rem) clamp(1rem, 2.6vw, 1.5rem);
  }

  [data-bento-title] {
    font-size: clamp(1.05rem, 1.95vw, 1.45rem);
  }

  [data-cta="process-start"] {
    margin-top: calc(var(--space-4) * 0.8);
  }

  /* Slide-in entrance: odd from right, even from left; once, on view */
  [data-bento-card].bento-enter-hidden {
    opacity: 0;
    transform: translateX(var(--bento-slide-from, 24px));
  }

  [data-bento-card].bento-enter-shown {
    opacity: 1;
    transform: translateX(0);
    transition:
      opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/* Reduced motion: no slide */
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  [data-bento-card].bento-enter-hidden,
  [data-bento-card].bento-enter-shown {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}