/* ============================================================
   Enhancements: (1) contact form pop-up  (2) build-process infographic
   ============================================================ */

/* ------------------------------------------------------------
   1) CONTACT POP-UP MODAL
   ------------------------------------------------------------ */
.cta-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cta-modal.open { display: flex; }

.cta-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 16, 40, 0.6);
  backdrop-filter: blur(5px);
  animation: ctaFade 220ms ease;
}
@keyframes ctaFade { from { opacity: 0; } to { opacity: 1; } }

.cta-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 40px 120px rgba(8, 16, 40, 0.5);
  animation: ctaPop 300ms cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
@keyframes ctaPop {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cta-banner {
  padding: 26px 28px 22px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(135deg, #1b2a55, #2a3e7d 55%, #6d4eff);
  color: #fff;
  position: relative;
}
.cta-banner h3 { margin: 0 0 6px; font-size: 21px; }
.cta-banner p { margin: 0; font-size: 13.5px; opacity: 0.82; line-height: 1.5; }
.cta-x {
  position: absolute; top: 16px; right: 16px;
  width: 34px; height: 34px; border: 0; cursor: pointer;
  border-radius: 9px; font-size: 20px; line-height: 1;
  color: #fff; background: rgba(255, 255, 255, 0.16);
  transition: background 160ms ease;
}
.cta-x:hover { background: rgba(255, 255, 255, 0.3); }

.cta-body { padding: 22px 28px 28px; }

/* The roomy form */
.cta-form { display: grid; gap: 14px; }
.cta-field { display: grid; gap: 6px; }
.cta-field label { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.cta-field label .req { color: #e5484d; }
.cta-field .hint { font-size: 11.5px; color: var(--muted); font-weight: 500; }

.cta-form input,
.cta-form select,
.cta-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fbfdff;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.cta-form input:focus,
.cta-form select:focus,
.cta-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 117, 255, 0.16);
  background: #fff;
}
.cta-form textarea { min-height: 132px; resize: vertical; line-height: 1.55; }

/* chip multi-select for project types */
.cta-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cta-chip {
  cursor: pointer;
  font-size: 12.5px; font-weight: 700;
  padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); color: var(--muted);
  background: #fff; transition: all 160ms ease; user-select: none;
}
.cta-chip:hover { border-color: rgba(37, 117, 255, 0.5); color: var(--ink); }
.cta-chip.active {
  border-color: var(--blue); color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.cta-submit {
  margin-top: 4px;
  padding: 14px 20px; border: 0; cursor: pointer;
  border-radius: 12px; font-size: 14.5px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 12px 30px rgba(37, 117, 255, 0.3);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.cta-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(37, 117, 255, 0.4); }
.cta-submit:active { transform: translateY(0); }
.cta-submit[disabled] { opacity: 0.7; cursor: default; transform: none; }

.cta-status { margin: 0; font-size: 13px; font-weight: 600; min-height: 18px; }
.cta-status[data-state="success"] { color: #0f9a66; }
.cta-status[data-state="error"]   { color: #e5484d; }

/* honeypot inside modal */
.cta-form .hp-field {
  position: absolute !important; left: -9999px !important;
  width: 1px; height: 1px; opacity: 0; pointer-events: none;
}

/* footer trigger button (replaces inline form) */
.footer-cta-btn {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 16px; padding: 13px 22px;
  border-radius: 12px; font-size: 14.5px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 12px 30px rgba(37, 117, 255, 0.32);
  cursor: pointer; border: 0;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.footer-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(37, 117, 255, 0.42); }
.footer-cta-btn .arrow { transition: transform 200ms ease; }
.footer-cta-btn:hover .arrow { transform: translateX(4px); }

@media (max-width: 560px) {
  .cta-modal { padding: 12px; }
  .cta-banner { padding: 22px 20px 18px; }
  .cta-body { padding: 18px 20px 22px; }
}

/* ------------------------------------------------------------
   2) BUILD-PROCESS INFOGRAPHIC (animated timeline)
   ------------------------------------------------------------ */
.build-flow { position: relative; margin-top: 26px; }

/* progress spine — always sits BEHIND every box & node */
.build-flow .spine {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 3px;
  transform: translateX(-50%);
  background: #e3e9f8; border-radius: 999px; overflow: hidden;
  z-index: 0;
}
.build-flow .spine > i {
  position: absolute; top: 0; left: 0; right: 0; height: 0%;
  background: linear-gradient(180deg, var(--blue), var(--violet));
  transition: height 900ms cubic-bezier(0.3, 0.8, 0.3, 1);
}

.build-step {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  align-items: center;
  margin-bottom: 26px;
}
.build-step:last-child { margin-bottom: 0; }

/* the node on the spine */
.build-node {
  grid-column: 2;
  justify-self: center;
  width: 58px; height: 58px; border-radius: 18px;
  display: grid; place-items: center;
  background: #fff; border: 2px solid var(--line);
  box-shadow: 0 8px 22px rgba(45, 64, 130, 0.1);
  z-index: 2;
  transition: transform 420ms cubic-bezier(0.2, 0.9, 0.3, 1.4), border-color 420ms ease, box-shadow 420ms ease;
  transform: scale(0.4); opacity: 0;
}
.build-node img { width: 28px; height: 28px; }
.build-node .num {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

/* the detail card — above the spine */
.build-card {
  position: relative; z-index: 1;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; box-shadow: 0 10px 30px rgba(45, 64, 130, 0.07);
  opacity: 0; transition: opacity 520ms ease, transform 520ms cubic-bezier(0.2, 0.8, 0.3, 1),
                          box-shadow 360ms ease, border-color 360ms ease;
}
.build-card h3 { margin: 0 0 5px; font-size: 16px; color: var(--ink); }
.build-card p  { margin: 0 0 10px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.build-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.build-card .tag {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: #eef3ff; color: var(--blue);
}

/* the secondary "what you get" card (fills the opposite column) */
.build-aside {
  position: relative; z-index: 1;
  align-self: center;
  opacity: 0; transition: opacity 560ms ease 80ms, transform 560ms cubic-bezier(0.2, 0.8, 0.3, 1) 80ms;
}
.aside-eyebrow {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.02em;
  color: var(--violet); background: rgba(113, 60, 243, 0.1);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 8px;
}
.aside-out { font-size: 12.5px; color: var(--muted); }
.aside-out b { display: block; font-size: 12px; color: var(--ink); margin-bottom: 5px; }
.aside-out ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 5px; }
.aside-out li { position: relative; padding-left: 18px; line-height: 1.4; }
.aside-out li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: #18b27a; font-weight: 900; font-size: 11px;
}

/* --- column placement: card near-left / aside far-right on ODD rows, swapped on EVEN --- */
.build-step:nth-child(odd)  .build-card  { grid-column: 1; transform: translateX(-28px); text-align: right; }
.build-step:nth-child(odd)  .build-card .tags { justify-content: flex-end; }
.build-step:nth-child(odd)  .build-aside { grid-column: 3; transform: translateX(28px); text-align: left; }

.build-step:nth-child(even) .build-card  { grid-column: 3; transform: translateX(28px); }
.build-step:nth-child(even) .build-aside { grid-column: 1; transform: translateX(-28px); text-align: right; }
.build-step:nth-child(even) .build-aside .aside-out ul { justify-items: end; }
.build-step:nth-child(even) .build-aside .aside-out li { padding-left: 0; padding-right: 18px; }
.build-step:nth-child(even) .build-aside .aside-out li::before { left: auto; right: 0; }

/* revealed state (toggled by JS) */
.build-step.show .build-node  { transform: scale(1); opacity: 1; border-color: var(--blue); box-shadow: 0 12px 30px rgba(37, 117, 255, 0.28); }
.build-step.show .build-card  { opacity: 1; transform: translateX(0); }
.build-step.show .build-aside { opacity: 1; transform: translateX(0); }

/* --- FOCUS state: the clicked step becomes the centre of attention --- */
.build-flow.has-focus .build-step { transition: opacity 360ms ease, filter 360ms ease; }
.build-flow.has-focus .build-step:not(.focus) { opacity: 0.4; filter: saturate(0.6); }
.build-step.focus .build-node {
  transform: scale(1.18);
  border-color: var(--violet);
  box-shadow: 0 0 0 6px rgba(113, 60, 243, 0.16), 0 16px 40px rgba(113, 60, 243, 0.35);
}
.build-step.focus .build-card {
  border-color: rgba(113, 60, 243, 0.5);
  box-shadow: 0 22px 50px rgba(113, 60, 243, 0.22);
  transform: scale(1.03);
}

/* virtual auto-play cursor */
.build-cursor {
  position: absolute; top: 0; left: 0; width: 22px; height: 22px; z-index: 20;
  pointer-events: none; opacity: 0;
  transform: translate(0, 0);
  transition: transform 720ms cubic-bezier(0.45, 0.05, 0.2, 1), opacity 300ms ease;
  background: no-repeat center/contain
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 2l6 16 2.5-6.5L19 9z' fill='%23713cf3' stroke='white' stroke-width='1.4' stroke-linejoin='round'/></svg>");
  filter: drop-shadow(0 3px 6px rgba(45, 64, 130, 0.35));
}
.build-cursor.show { opacity: 1; }
.build-cursor.click::after {
  content: ""; position: absolute; left: -9px; top: -9px;
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--violet);
  animation: buildRipple 480ms ease-out;
}
@keyframes buildRipple { from { transform: scale(0.3); opacity: 0.8; } to { transform: scale(1.5); opacity: 0; } }

@media (max-width: 720px) {
  .build-flow .spine { left: 28px; }
  .build-step { grid-template-columns: 56px 1fr; gap: 12px; margin-bottom: 22px; }
  .build-node { grid-column: 1; }
  /* on mobile, stack card over aside in the single content column */
  .build-step:nth-child(odd)  .build-card,
  .build-step:nth-child(even) .build-card,
  .build-step:nth-child(odd)  .build-aside,
  .build-step:nth-child(even) .build-aside {
    grid-column: 2; text-align: left; transform: translateX(22px);
  }
  .build-step .build-card  { grid-row: 1; }
  .build-step .build-aside { grid-row: 2; margin-top: 8px; }
  .build-step:nth-child(odd)  .build-card .tags { justify-content: flex-start; }
  .build-step:nth-child(even) .build-aside .aside-out ul { justify-items: start; }
  .build-step:nth-child(even) .build-aside .aside-out li { padding-left: 18px; padding-right: 0; }
  .build-step:nth-child(even) .build-aside .aside-out li::before { left: 0; right: auto; }
  .build-cursor { display: none; }
}
