/* Praedix enhancements — scroll-reveal, tilt, counter, thinking widget.
   Theme: accent #31EDAE, bg #1E1E1E. Keep animations soft & subtle. */

:root {
  --pdx-accent: #31EDAE;
  --pdx-accent-dim: rgba(49, 237, 174, 0.14);
  --pdx-bg: #1E1E1E;
  --pdx-bg-card: #262626;
  --pdx-bg-card-hover: #2d2d2d;
  --pdx-border: rgba(255, 255, 255, 0.08);
  --pdx-text: #f2f2f2;
  --pdx-text-dim: rgba(242, 242, 242, 0.62);
  --pdx-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 1. Scroll reveal ---------- */
.pdx-reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 0.85s var(--pdx-ease),
    transform 0.85s var(--pdx-ease);
  will-change: opacity, transform;
}
.pdx-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
@media (prefers-reduced-motion: reduce) {
  .pdx-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- 2. Tilt / magnetic hover ---------- */
.pdx-tilt {
  transform: perspective(800px) rotateX(0) rotateY(0) translateZ(0);
  transition: transform 0.45s var(--pdx-ease), box-shadow 0.45s var(--pdx-ease);
  will-change: transform;
}
.pdx-magnet {
  transition: transform 0.35s var(--pdx-ease);
  will-change: transform;
}

/* ---------- 3. Thinking widget ---------- */
.pdx-section {
  position: relative;
  padding: 96px 20px;
  background: var(--pdx-bg);
  color: var(--pdx-text);
  font-family: inherit;
  overflow: hidden;
}
.pdx-section__inner {
  max-width: 1400px;
  margin: 0 auto;
}
.pdx-section--stats,
.pdx-section--roi,
.pdx-section--thinking {
  padding-left: 48px;
  padding-right: 48px;
}
@media (max-width: 900px) {
  .pdx-section--stats,
  .pdx-section--roi,
  .pdx-section--thinking { padding-left: 24px; padding-right: 24px; }
}
.pdx-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pdx-accent);
  padding: 6px 14px;
  background: var(--pdx-accent-dim);
  border: 1px solid rgba(49, 237, 174, 0.2);
  border-radius: 999px;
}
.pdx-kicker::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pdx-accent);
  animation: pdx-pulse 2.2s var(--pdx-ease) infinite;
}
@keyframes pdx-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}
.pdx-section__title {
  margin: 18px 0 12px;
  font-size: clamp(28px, 4.2vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}
.pdx-section__title em {
  color: var(--pdx-accent);
  font-style: normal;
}
.pdx-section__lede {
  color: var(--pdx-text-dim);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
  max-width: 640px;
}

.pdx-thinking {
  margin-top: 44px;
  padding: 32px;
  background: linear-gradient(180deg, #222 0%, #1c1c1c 100%);
  border: 1px solid var(--pdx-border);
  border-radius: 24px;
  display: grid;
  gap: 18px;
  max-width: 100%;
  position: relative;
}
.pdx-msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--pdx-ease), transform 0.5s var(--pdx-ease);
}
.pdx-msg.is-visible { opacity: 1; transform: none; }
.pdx-avatar {
  flex: 0 0 32px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}
.pdx-avatar--user {
  background: #333;
  color: var(--pdx-text);
}
.pdx-avatar--ai {
  background: var(--pdx-accent);
  color: #0b1f18;
}
.pdx-bubble {
  flex: 1;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.5;
  background: #2a2a2a;
  color: var(--pdx-text);
  min-height: 22px;
  position: relative;
}
.pdx-msg--ai .pdx-bubble {
  background: rgba(49, 237, 174, 0.08);
  border: 1px solid rgba(49, 237, 174, 0.22);
}
.pdx-caret {
  display: inline-block;
  width: 8px; height: 1.1em;
  background: var(--pdx-accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: pdx-caret 1s steps(1) infinite;
  transform: translateY(2px);
}
@keyframes pdx-caret {
  50% { opacity: 0; }
}
.pdx-dots {
  display: inline-flex; gap: 4px;
  align-items: center;
}
.pdx-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pdx-accent);
  opacity: 0.35;
  animation: pdx-dot 1.2s var(--pdx-ease) infinite;
}
.pdx-dots span:nth-child(2) { animation-delay: 0.15s; }
.pdx-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes pdx-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- 4. Counter / stats ---------- */
.pdx-stats {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 960px) {
  .pdx-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .pdx-stats { grid-template-columns: 1fr; }
}
.pdx-stat {
  padding: 36px 32px;
  background: linear-gradient(180deg, #242424 0%, #1d1d1d 100%);
  border: 1px solid var(--pdx-border);
  border-radius: 24px;
  transition: transform 0.45s var(--pdx-ease), background 0.45s var(--pdx-ease), border-color 0.45s var(--pdx-ease);
  position: relative;
  overflow: hidden;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.pdx-stat::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px; width: 0;
  background: linear-gradient(90deg, transparent, var(--pdx-accent), transparent);
  transition: width 0.8s var(--pdx-ease);
}
.pdx-stat.is-visible::after { width: 100%; }
.pdx-stat:hover {
  background: var(--pdx-bg-card-hover);
  border-color: rgba(49, 237, 174, 0.28);
  transform: translateY(-3px);
}
.pdx-stat__num {
  font-size: clamp(44px, 5.6vw, 68px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--pdx-accent);
  font-variant-numeric: tabular-nums;
}
.pdx-stat__suffix { color: var(--pdx-accent); font-size: 0.7em; margin-left: 2px; }
.pdx-stat__label {
  margin-top: 16px;
  font-size: 15px;
  color: var(--pdx-text-dim);
  line-height: 1.5;
}

/* ---------- 5. ROI calculator ---------- */
.pdx-roi {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  padding: 36px;
  background: linear-gradient(180deg, #222 0%, #1c1c1c 100%);
  border: 1px solid var(--pdx-border);
  border-radius: 24px;
  max-width: 100%;
}
.pdx-roi__controls { display: grid; gap: 22px; align-content: center; }
.pdx-roi__field { display: grid; gap: 10px; }
.pdx-roi__field label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 14px; color: var(--pdx-text-dim);
}
.pdx-roi__field label b {
  color: var(--pdx-text);
  font-weight: 600;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.pdx-roi input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: #2a2a2a;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.pdx-roi input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  background: var(--pdx-accent);
  border-radius: 50%;
  cursor: grab;
  transition: transform 0.2s var(--pdx-ease);
}
.pdx-roi input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.15); }
.pdx-roi input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--pdx-accent);
  border-radius: 50%; border: none;
  cursor: grab;
}
.pdx-roi__result {
  background: #191919;
  border: 1px solid var(--pdx-border);
  border-radius: 16px;
  padding: 24px;
  display: grid; gap: 10px;
  align-content: center;
}
.pdx-roi__result-label {
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--pdx-text-dim);
}
.pdx-roi__result-num {
  font-size: clamp(40px, 5.6vw, 64px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--pdx-accent);
  font-variant-numeric: tabular-nums;
}
.pdx-roi__result-sub {
  color: var(--pdx-text-dim);
  font-size: 14px;
  line-height: 1.5;
}
.pdx-roi__result-sub b { color: var(--pdx-text); font-weight: 600; }
@media (max-width: 760px) {
  .pdx-roi { grid-template-columns: 1fr; padding: 24px; }
}

/* ---------- 6. ⌘K Command palette ---------- */
.pdx-cmdk {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s var(--pdx-ease);
}
.pdx-cmdk.is-open { display: flex; opacity: 1; }
.pdx-cmdk__box {
  width: min(560px, calc(100% - 32px));
  background: #1b1b1b;
  border: 1px solid var(--pdx-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
  transform: translateY(-8px);
  transition: transform 0.2s var(--pdx-ease);
}
.pdx-cmdk.is-open .pdx-cmdk__box { transform: translateY(0); }
.pdx-cmdk__input {
  width: 100%;
  padding: 18px 20px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--pdx-border);
  color: var(--pdx-text);
  font-size: 16px;
  outline: none;
  font-family: inherit;
}
.pdx-cmdk__input::placeholder { color: var(--pdx-text-dim); }
.pdx-cmdk__list {
  list-style: none;
  margin: 0; padding: 8px;
  max-height: 50vh;
  overflow: auto;
}
.pdx-cmdk__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--pdx-text);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.12s var(--pdx-ease);
}
.pdx-cmdk__item[aria-selected="true"] { background: rgba(49, 237, 174, 0.12); }
.pdx-cmdk__item:hover { background: rgba(255,255,255,0.04); }
.pdx-cmdk__icon {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: #262626;
  display: grid; place-items: center;
  color: var(--pdx-accent);
  font-size: 13px;
  font-weight: 700;
}
.pdx-cmdk__label { flex: 1; }
.pdx-cmdk__hint {
  color: var(--pdx-text-dim);
  font-size: 12px;
}
.pdx-cmdk__footer {
  display: flex;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--pdx-border);
  font-size: 12px;
  color: var(--pdx-text-dim);
  background: #171717;
}
.pdx-cmdk__kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--pdx-border);
  border-radius: 5px;
  background: #242424;
  color: var(--pdx-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  margin-right: 4px;
}
.pdx-cmdk__empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--pdx-text-dim);
  font-size: 14px;
}

/* floating hint chip */
.pdx-cmdk-hint {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 2147482000;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(30, 30, 30, 0.85);
  border: 1px solid var(--pdx-border);
  color: var(--pdx-text-dim);
  font-size: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--pdx-ease), transform 0.3s var(--pdx-ease);
  pointer-events: none;
}
@media (min-width: 900px) { .pdx-cmdk-hint { display: inline-flex; } }
.pdx-cmdk-hint.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Subtle dots background for our sections ---------- */
.pdx-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  pointer-events: none;
}

/* small screens */
@media (max-width: 640px) {
  .pdx-section { padding: 64px 18px; }
  .pdx-thinking { padding: 20px; margin-top: 32px; }
  .pdx-stats { gap: 12px; margin-top: 32px; }
  .pdx-stat { padding: 22px 18px; }
}
