/* ==========================================================================
   KKWEBMART DIGITAL SOLUTIONS — OUR PROCESS: 3D PLAYING CARD FLIP EXPERIENCE
   Inspired by Teen Patti 4-card fan spread with 3D Card Flip on GSAP ScrollTrigger
   ========================================================================== */

#process {
  position: relative;
  background: radial-gradient(circle at 50% 36%, rgba(200, 162, 90, 0.08) 0%, transparent 65%), #f7f9fc;
  border-block: 1px solid #e5ebf4;
  overflow: clip;
  z-index: 25;
  margin-top: clamp(24px, 5vw, 48px);
  margin-bottom: clamp(32px, 6vw, 64px);
}

#process .process-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 24px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* Header */
.process-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

#process .kicker {
  color: #976b25;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

#process .section-title {
  color: #0b1c3d;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 auto 6px;
}

#process .lead {
  color: #52637a;
  font-size: clamp(13px, 1.35vw, 15px);
  line-height: 1.45;
  max-width: 660px;
  margin: 0 auto;
}

/* ==========================================================================
   INTERACTIVE JOURNEY STATUS TRACK
   ========================================================================== */
.process-journey {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 680px;
  margin: 12px auto 0;
  padding: 0 14px;
  gap: 10px;
}

.process-journey__track {
  position: absolute;
  left: 32px;
  right: 32px;
  top: 50%;
  height: 2px;
  background: #dce4f0;
  transform: translateY(-50%);
  z-index: 1;
}

.process-journey__track i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1b6bff 0%, #deb86a 100%);
  border-radius: 999px;
  transition: width 0.12s ease-out;
  box-shadow: 0 0 10px rgba(222, 184, 106, 0.4);
}

.process-journey__step {
  position: relative;
  z-index: 2;
  background: #ffffff;
  border: 1.5px solid #d5e0ee;
  border-radius: 999px;
  padding: 5px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: #607089;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: 0 2px 5px rgba(11, 28, 61, 0.05);
}

.process-journey__step:hover {
  border-color: #deb86a;
  color: #0b1c3d;
  transform: translateY(-1px);
}

.process-journey__step .pj-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: #8c9cb0;
}

.process-journey__step .pj-suit {
  font-size: 12px;
  opacity: 0.7;
}

.process-journey__step.is-active {
  background: #0b1c3d;
  border-color: #deb86a;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(11, 28, 61, 0.18);
}

.process-journey__step.is-active .pj-num {
  color: #deb86a;
}

.process-journey__step.is-flipped {
  border-color: #deb86a;
}

.process-journey__step.is-flipped .pj-suit {
  opacity: 1;
  color: #deb86a;
}

/* ==========================================================================
   FAN STAGE & 3D CARD DECK
   ========================================================================== */
.process-fan-stage {
  position: relative;
  width: 100%;
  max-width: 1060px;
  height: 385px;
  margin: 10px auto 0;
  perspective: 1800px;
  perspective-origin: 50% 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.process-fan-deck {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

/* The card slot holds the static fan spread position */
.pcard {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 235px;
  height: 345px;
  margin-left: -117.5px;
  margin-top: -172.5px;
  border-radius: 18px;
  transform-origin: 50% 90%;
  transform: translate3d(var(--fan-x, 0px), var(--fan-y, 0px), 0px) rotate(var(--fan-r, 0deg));
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* Desktop Fan Spread Coordinates */
.pcard--0 {
  --fan-x: -310px;
  --fan-y: 18px;
  --fan-r: -16deg;
  z-index: 1;
}

.pcard--1 {
  --fan-x: -100px;
  --fan-y: 4px;
  --fan-r: -5deg;
  z-index: 2;
}

.pcard--2 {
  --fan-x: 100px;
  --fan-y: 4px;
  --fan-r: 5deg;
  z-index: 3;
}

.pcard--3 {
  --fan-x: 310px;
  --fan-y: 18px;
  --fan-r: 16deg;
  z-index: 4;
}

/* Inner Flipper Handles Pure Y-axis 3D Flip and Z-lift */
.pcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  will-change: transform;
  border-radius: 18px;
  box-shadow: 0 16px 36px -10px rgba(7, 17, 39, 0.35), 0 3px 8px rgba(7, 17, 39, 0.08);
  transition: box-shadow 0.3s ease;
}

.pcard:focus-visible .pcard-inner {
  box-shadow: 0 0 0 3px #deb86a, 0 18px 40px -10px rgba(7, 17, 39, 0.4);
}

/* Card Faces */
.pcard-face {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* ==========================================================================
   CARD BACK: LUXURY CASINO GUIPURE & GOLD FILIGREE (TEEN PATTI STYLE)
   ========================================================================== */
.pcard-back {
  background: linear-gradient(145deg, #0d1e3d 0%, #060e1f 100%);
  border: 1.5px solid #deb86a;
  transform: rotateY(0deg);
  z-index: 2;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Repeating geometric diamond lattice pattern */
.pcard-back-pattern {
  position: absolute;
  inset: 8px;
  border-radius: 13px;
  background-color: #081329;
  background-image:
    repeating-linear-gradient(45deg, rgba(222, 184, 106, 0.09) 0, rgba(222, 184, 106, 0.09) 1px, transparent 0, transparent 11px),
    repeating-linear-gradient(-45deg, rgba(222, 184, 106, 0.09) 0, rgba(222, 184, 106, 0.09) 1px, transparent 0, transparent 11px);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7);
}

/* Gold Frame with corner flourishing */
.pcard-back-frame {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(222, 184, 106, 0.38);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.pcard-back-frame::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(222, 184, 106, 0.2);
  border-radius: 7px;
  pointer-events: none;
}

/* Card Back Corner Indices */
.pcard-back-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #deb86a;
  opacity: 0.85;
}

.pcard-back-corner .suit {
  font-size: 12px;
  margin-top: 2px;
}

.pcard-back-corner.tl {
  top: 9px;
  left: 9px;
}

.pcard-back-corner.br {
  bottom: 9px;
  right: 9px;
  transform: rotate(180deg);
}

/* Golden Seal Medallion in Center */
.pcard-seal {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pcard-seal-outer {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px dashed rgba(222, 184, 106, 0.75);
  padding: 3px;
  background: radial-gradient(circle, rgba(222, 184, 106, 0.16) 0%, transparent 70%);
  box-shadow: 0 0 18px rgba(222, 184, 106, 0.22);
  display: grid;
  place-items: center;
}

.pcard-seal-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #071127;
  display: grid;
  place-items: center;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), 0 3px 8px rgba(0, 0, 0, 0.35);
}

.pcard-seal-logo {
  display: block;
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.pcard-seal-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 700;
  color: #deb86a;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ==========================================================================
   CARD FRONT: PEARL FINISH & PLAYING CARD INDICES
   ========================================================================== */
.pcard-front {
  background: linear-gradient(165deg, #ffffff 0%, #f7f9fd 100%);
  border: 1.5px solid #d4c19c;
  transform: rotateY(180deg);
  z-index: 1;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #0b1c3d;
  box-shadow: inset 0 0 20px rgba(200, 162, 90, 0.04);
}

/* Corner Ranks & Suits */
.pcard-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #0b1c3d;
  z-index: 5;
}

.pcard-corner .suit {
  font-size: 13px;
  margin-top: 2px;
}

.pcard-corner.tl {
  top: 12px;
  left: 12px;
}

.pcard-corner.br {
  bottom: 12px;
  right: 12px;
  transform: rotate(180deg);
}

/* Suit Colors */
.pcard--diamond .pcard-corner,
.pcard--diamond .deliv-icon,
.pcard--diamond .badge-suit {
  color: #c62828;
}

.pcard-front-body {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pcard-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(11, 28, 61, 0.06);
  color: #0b1c3d;
  border: 1px solid rgba(11, 28, 61, 0.12);
  margin-left: 18px;
  margin-bottom: 10px;
}

.pcard-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #0b1c3d;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.pcard-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: #52637a;
  margin: 0 0 10px 0;
}

.pcard-deliverables {
  list-style: none;
  padding: 0;
  margin: 0 0 auto 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pcard-deliverables li {
  font-size: 11.5px;
  font-weight: 500;
  color: #26364d;
  display: flex;
  align-items: center;
  gap: 7px;
}

.deliv-icon {
  font-size: 10px;
  color: #aa813b;
}

.pcard-foot {
  padding-top: 8px;
  border-top: 1px solid rgba(11, 28, 61, 0.08);
  margin-top: 8px;
}

.pcard-phase {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8c9cb0;
}

/* ==========================================================================
   CARD 04 (SCALE ♥) — TEEN PATTI SIGNATURE 3D RED HEART ON VELVET OBSIDIAN
   ========================================================================== */
.pcard--heart .pcard-front {
  background: linear-gradient(165deg, #101c30 0%, #060c18 100%);
  border: 1.5px solid #deb86a;
  color: #ffffff;
  box-shadow: 0 18px 38px -10px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

.pcard--heart .pcard-corner {
  color: #ff3355;
}

.pcard--heart .pcard-badge {
  background: rgba(255, 51, 85, 0.16);
  color: #ff4d6d;
  border-color: rgba(255, 51, 85, 0.35);
}

.pcard--heart .badge-suit {
  color: #ff3355;
}

.pcard--heart .pcard-title {
  color: #ffffff;
}

.pcard--heart .pcard-desc {
  color: #b0c2dd;
}

.pcard--heart .pcard-deliverables li {
  color: #e2edfd;
}

.pcard--heart .deliv-icon {
  color: #ff3355;
}

.pcard--heart .pcard-foot {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.pcard--heart .pcard-phase {
  color: #deb86a;
}

/* 3D Glossy Ruby Heart Emblem */
.pcard-heart-emblem {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 44px;
  height: 40px;
  z-index: 4;
}

.glossy-3d-heart {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 5px 12px rgba(230, 0, 38, 0.5));
}

/* ==========================================================================
   BOTTOM HINT & PROGRESS METER BAR
   ========================================================================== */
.process-deck-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 680px;
  margin: 16px auto 0;
  padding: 0 16px;
  color: #607089;
  font-family: 'DM Sans', sans-serif;
  font-size: 11.5px;
}

.process-scroll-prompt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #0b1c3d;
  font-weight: 500;
}

.prompt-arrow {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e6edf8;
  color: #0b1c3d;
  font-size: 11px;
  font-weight: 700;
  animation: promptBounce 1.8s infinite ease-in-out;
}

@keyframes promptBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

.process-deck-meter-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.process-meter-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: #976b25;
}

.process-meter-bar {
  width: 80px;
  height: 4px;
  background: #dce4f0;
  border-radius: 999px;
  overflow: hidden;
}

.process-meter-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #1b6bff, #deb86a);
  border-radius: 999px;
  transition: width 0.12s ease-out;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 960px) {
  #process .process-inner {
    padding: 24px 18px 50px;
  }

  .process-fan-stage {
    height: 360px;
    margin-top: 10px;
  }

  .pcard {
    width: 215px;
    height: 325px;
    margin-left: -107.5px;
    margin-top: -162.5px;
  }

  .pcard--0 { --fan-x: -230px; --fan-y: 16px; --fan-r: -14deg; }
  .pcard--1 { --fan-x: -75px;  --fan-y: 4px;  --fan-r: -4.5deg; }
  .pcard--2 { --fan-x: 75px;   --fan-y: 4px;  --fan-r: 4.5deg; }
  .pcard--3 { --fan-x: 230px;  --fan-y: 16px; --fan-r: 14deg; }

  .pcard-front {
    padding: 16px 14px;
  }

  .pcard-title {
    font-size: 20px;
  }

  .pcard-desc {
    font-size: 11.5px;
    line-height: 1.4;
  }

  .pcard-deliverables li {
    font-size: 10.5px;
  }
}

@media (max-width: 768px) {
  #process .process-inner {
    padding: 28px 14px 44px;
  }

  .process-header {
    max-width: 100%;
  }

  #process .kicker {
    margin-bottom: 12px;
    line-height: 1.6;
  }

  #process .section-title {
    margin-bottom: 12px;
    line-height: 1.25;
    text-wrap: balance;
  }

  #process .lead {
    line-height: 1.65;
    max-width: 40ch;
  }

  .process-fan-stage {
    height: 330px;
    margin-top: 16px;
  }

  .pcard {
    width: 195px;
    height: 300px;
    margin-left: -97.5px;
    margin-top: -150px;
    border-radius: 16px;
  }

  /* Compact overlapping fan for mobile */
  .pcard--0 { --fan-x: -75px; --fan-y: 12px; --fan-r: -9deg; }
  .pcard--1 { --fan-x: -25px; --fan-y: 3px;  --fan-r: -3deg; }
  .pcard--2 { --fan-x: 25px;  --fan-y: 3px;  --fan-r: 3deg; }
  .pcard--3 { --fan-x: 75px;  --fan-y: 12px; --fan-r: 9deg; }

  .pcard-inner {
    border-radius: 16px;
  }

  .pcard-face {
    border-radius: 16px;
  }

  .pcard-front {
    padding: 14px 12px 12px;
  }

  .pcard-badge {
    margin-left: 12px;
    margin-bottom: 8px;
    font-size: 8.5px;
    padding: 2px 7px;
  }

  .pcard-title {
    font-size: 18px;
    margin-bottom: 4px;
  }

  .pcard-desc {
    font-size: 11px;
    line-height: 1.35;
    margin-bottom: 8px;
  }

  .pcard-deliverables {
    gap: 4px;
  }

  .pcard-deliverables li {
    font-size: 10px;
  }

  .pcard-seal-outer {
    width: 56px;
    height: 56px;
  }

  .pcard-seal-text {
    font-size: 7px;
  }

  .pcard-heart-emblem {
    width: 34px;
    height: 31px;
    right: 12px;
    top: 12px;
  }

  .process-journey {
    gap: 5px;
    padding: 0 4px;
    margin-top: 20px;
  }

  .process-journey__step {
    padding: 3px 8px;
    font-size: 10.5px;
    gap: 4px;
  }

  .process-journey__step .pj-suit {
    display: none;
  }

  .process-deck-bar {
    font-size: 10.5px;
    padding: 0 8px;
    margin-top: 12px;
  }

  .prompt-text {
    font-size: 10.5px;
  }
}

@media (max-width: 420px) {
  #process .process-inner {
    padding: 24px 12px 40px;
  }

  .process-fan-stage {
    height: 310px;
  }

  .pcard {
    width: 180px;
    height: 280px;
    margin-left: -90px;
    margin-top: -140px;
  }

  .pcard--0 { --fan-x: -60px; --fan-y: 10px; --fan-r: -8deg; }
  .pcard--1 { --fan-x: -20px; --fan-y: 2px;  --fan-r: -2.5deg; }
  .pcard--2 { --fan-x: 20px;  --fan-y: 2px;  --fan-r: 2.5deg; }
  .pcard--3 { --fan-x: 60px;  --fan-y: 10px; --fan-r: 8deg; }

  .pcard-front {
    padding: 12px 10px 10px;
  }

  .pcard-title {
    font-size: 17px;
  }

  .pcard-desc {
    font-size: 10px;
    line-height: 1.3;
  }

  .pcard-deliverables li {
    font-size: 9px;
  }

  .process-journey__step .pj-name {
    display: none;
  }

  .process-journey__step {
    padding: 3px 8px;
    border-radius: 999px;
  }

  .process-meter-bar {
    width: 50px;
  }
}

/* Keep the pinned scene stable as mobile browser controls appear/disappear. */
@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
  #process {
    height: calc(100svh - var(--process-nav-height, 75px));
    margin-block: 0;
  }

  #process .process-inner {
    height: 100%;
    padding-top: clamp(12px, 3svh, 28px);
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .process-header,
  .process-journey,
  .process-deck-bar {
    flex-shrink: 0;
  }

  .process-fan-stage {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
  }

  .process-fan-deck {
    transform: scale(var(--process-deck-scale, 1));
    transform-origin: center;
  }
}

@media (min-width: 540px) and (max-width: 768px) and (max-height: 500px) and (prefers-reduced-motion: no-preference) {
  #process .process-inner {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "header journey" "header cards" "header progress";
    gap: 10px 20px;
    padding: 12px 16px;
    align-items: stretch;
  }

  .process-header { grid-area: header; align-self: center; }
  #process .section-title { font-size: 22px; }
  #process .lead { font-size: 12px; }
  .process-journey { grid-area: journey; margin: 0; }
  .process-fan-stage { grid-area: cards; margin: 0; }
  .process-deck-bar { grid-area: progress; margin: 0; padding: 0; }
  .process-journey__step .pj-name { display: none; }
}

/* ==========================================================================
   ACCESSIBILITY: PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .process-fan-stage {
    height: auto;
    perspective: none;
  }

  .process-fan-deck {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    width: 100%;
    height: auto;
  }

  .pcard {
    position: static;
    width: 100%;
    height: auto;
    min-height: 340px;
    margin: 0;
    transform: none !important;
  }

  .pcard-inner {
    transform: none !important;
  }

  .pcard-back {
    display: none !important;
  }

  .pcard-front {
    position: relative;
    transform: none !important;
    inset: auto;
    height: 100%;
  }

  .prompt-arrow {
    animation: none;
  }
}
