/* ============================================================
   HOXROCKS: interactive addons v2.6.0  (BLACK & WHITE)
   Loaded ONLY on the front page + How It Works.
   Components: DOM phone (.hxp), hero paper->digital stage,
   industry chips, playable job sheet, living dashboard.
   ============================================================ */

/* ---------- DOM phone component ---------- */
.hxp {
  width: 300px; background: #000000; border-radius: 36px; padding: 8px;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.35);
  font-family: var(--wp--preset--font-family--body);
  user-select: none;
}
.hxp-inner { background: #2E2E2E; border-radius: 30px; padding: 7px; }
.hxp-screen { background: #F4F4F4; border-radius: 24px; overflow: hidden; }
.hxp-bar { background: #000000; padding: 14px 18px 12px; display: flex; gap: 11px; align-items: center; }
.hxp-bar svg { width: 26px; height: 26px; flex: 0 0 auto; }
.hxp-bar-title { color: #fff; font-weight: 700; font-size: 0.98rem; font-family: var(--wp--preset--font-family--heading); line-height: 1.2; }
.hxp-bar-ref { color: #9A9A9A; font-size: 0.7rem; margin-top: 1px; }
.hxp-body { padding: 14px 16px 16px; }
.hxp-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; color: #6E6E6E; text-transform: uppercase; margin: 10px 0 5px; }
.hxp-label:first-child { margin-top: 0; }
.hxp-field {
  background: #fff; border: 1px solid #767676; border-radius: 2px;
  padding: 9px 11px; font-size: 0.8rem; color: #000000;
}
.hxp-check {
  display: flex; align-items: center; gap: 9px; background: #fff;
  border: 1px solid #767676; border-radius: 2px; padding: 7px 10px; margin-bottom: 6px;
  font-size: 0.76rem; color: #4A4A4A; transition: border-color .15s ease;
}
.hxp-check-dot {
  flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #767676; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; transition: background .18s ease, border-color .18s ease;
}
.hxp-check.is-on { border-color: #000000; }
.hxp-check.is-on .hxp-check-dot { background: #000000; border-color: #000000; }
.hxp-check-dot::after {
  content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(0.5px, -1px); opacity: 0; transition: opacity .15s ease;
}
.hxp-check.is-on .hxp-check-dot::after { opacity: 1; }
.hxp-check.is-on { color: #000000; font-weight: 500; }
.hxp-photos { display: flex; gap: 7px; }
.hxp-photo {
  width: 62px; height: 46px; border-radius: 2px; background: #2E2E2E;
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.hxp-photo svg { width: 34px; height: 26px; }
.hxp-photo-add {
  width: 62px; height: 46px; border-radius: 2px; background: #fff;
  border: 1.5px dashed #767676; color: #6E6E6E; font-size: 1.1rem; min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center; cursor: default;
}
.hxp-sig {
  background: #fff; border: 1px solid #767676; border-radius: 2px;
  height: 62px; position: relative; overflow: hidden;
}
.hxp-sig svg, .hxp-sig canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hxp-chips { display: flex; gap: 7px; margin: 10px 0 0; }
.hxp-chip {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  font-size: 0.66rem; padding: 5px 10px; background: #EDEDED; color: #000000;
}
.hxp-chip.green { background: #000000; color: #FFFFFF; }
.hxp-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: #FFFFFF; }
.hxp-btn {
  margin-top: 11px; width: 100%; border: 0; border-radius: 2px; background: #000000;
  color: #fff; font-family: var(--wp--preset--font-family--heading);
  font-weight: 700; font-size: 0.9rem; padding: 12px 0; text-align: center; min-height: 44px;
}
.hxp--interactive .hxp-check, .hxp--interactive .hxp-photo-add, .hxp--interactive .hxp-btn { cursor: pointer; }
.hxp--interactive .hxp-btn:hover { background: #333333; }

/* ---------- hero stage: paper -> digital ---------- */
#hx-hero-stage { position: relative; }
.hxh-stage { position: relative; display: flex; justify-content: center; align-items: flex-end; padding-left: 84px; }
.hxh-stage .hxp { margin-bottom: -110px; position: relative; z-index: 2; }
.hxh-paper {
  position: absolute; z-index: 1; width: 190px; height: 250px; left: -40px; top: 30px;
  background: #FBFBF9; border-radius: 2px; transform: rotate(-9deg);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
  padding: 16px 14px;
}
.hxh-paper::before {
  content: "JOB SHEET"; display: block; font-family: var(--wp--preset--font-family--heading);
  font-size: 0.6rem; letter-spacing: 0.14em; color: #9A9A9A; margin-bottom: 8px;
}
.hxh-paper-line { height: 12px; margin: 9px 0; position: relative; }
.hxh-paper-line svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hxh-paper-stamp {
  position: absolute; bottom: 12px; left: 14px; right: 14px; text-align: center;
  font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 0.62rem;
  letter-spacing: 0.16em; color: #000000; border: 2px solid #000000; border-radius: 2px;
  padding: 4px 0; transform: rotate(-6deg); opacity: 0.85;
}
.hxh-fly {
  position: absolute; z-index: 3; pointer-events: none; opacity: 0;
  height: 12px; width: 120px;
}
.hxh-fly svg { width: 100%; height: 100%; }
.hxh-replay {
  position: absolute; z-index: 4; right: -4px; top: -10px; border: 1px solid rgba(255, 255, 255, 0.6); cursor: pointer;
  background: transparent; color: #C9C9C9; border-radius: 999px;
  font-size: 0.72rem; padding: 6px 12px; min-width: 44px; min-height: 44px; font-family: var(--wp--preset--font-family--body);
}
.hxh-replay:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* animation states (JS drives .play) */
.hxh-anim .hxh-paper { transition: transform .8s ease, opacity .6s ease; }
.hxh-anim.play .hxh-paper { transform: rotate(-4deg) translateY(-6px); }
.hxh-anim.done .hxh-paper { opacity: 0.5; }
.hxh-fly.go { animation: hxh-fly-to-phone .9s cubic-bezier(.5, .1, .3, 1) forwards; }
@keyframes hxh-fly-to-phone {
  0%   { opacity: 0; transform: translate(0, 0) scale(1) rotate(-9deg); }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--fly-x, 190px), var(--fly-y, 40px)) scale(0.7) rotate(0deg); }
}
.hxp-check.pop { animation: hxp-pop .35s ease; }
@keyframes hxp-pop { 50% { transform: scale(1.04); } }
.hxp-chip.pulse { animation: hxp-pulse .6s ease 2; }
@keyframes hxp-pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.25); } }

/* ---------- industry chips (on the black hero) ---------- */
.hx-industry { margin-top: 26px; }
.hx-industry-label { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: #9A9A9A; margin: 0 0 10px; font-weight: 700; font-family: var(--wp--preset--font-family--heading); }
.hx-industry-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hx-chip {
  border: 1px solid rgba(255, 255, 255, 0.6); background: transparent; color: #E4E4E4;
  border-radius: 999px; padding: 7px 14px; min-width: 44px; min-height: 44px; font-size: 0.8rem; cursor: pointer;
  font-family: var(--wp--preset--font-family--body); transition: all .15s ease;
}
.hx-chip:hover { border-color: #FFFFFF; color: #fff; }
/* emoji rendered monochrome so the palette stays strictly black & white */
.hx-chip-ico { display: inline-block; margin-right: 7px; filter: grayscale(1) contrast(1.15) brightness(1.3); }
.hx-chip.is-active .hx-chip-ico { filter: grayscale(1) contrast(1.15) brightness(0.55); }
.hx-chip.is-active { background: #FFFFFF; border-color: #FFFFFF; color: #000000; font-weight: 600; }
.hxp-swap { animation: hxp-swap .35s ease; }
@keyframes hxp-swap { 0% { opacity: 0.25; transform: translateY(4px); } 100% { opacity: 1; transform: none; } }

/* ---------- try-it section (light) ---------- */
#hx-tryit-mount[hidden] { display: none; }
#hx-tryit-mount { background: var(--hx-mist); }
.hx-tryit-grid { display: grid; grid-template-columns: 340px 1fr; gap: 44px; align-items: start; margin-top: 40px; }
.hx-tryit-phone { display: flex; justify-content: center; }
.hx-tryit-phone .hxp { width: 320px; }
.hx-tryit-sig-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6E6E6E; font-size: 0.78rem; pointer-events: none; transition: opacity .3s ease; }
.hx-tryit-sig-hint.hide { opacity: 0; }
.hxp-sig-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.hxp-sig-actions button {
  flex: 1 1 auto; min-width: 44px; min-height: 44px; border: 1px solid #767676; background: #fff;
  color: #000; border-radius: 2px; font: inherit; font-size: 0.75rem; padding: 8px; cursor: pointer;
}
.hxp-sig-actions button:disabled { color: #6E6E6E; cursor: default; }
.hxp-sig-sample { position: absolute; inset: 0; pointer-events: none; }
.hxp--interactive .hxp-check { position: relative; min-height: 46px; cursor: pointer; }
.hxp-check-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.hxp--interactive .hxp-check:focus-within { outline: 3px solid #000; outline-offset: 3px; }
.hxp--interactive button:focus-visible, .hxd-toggle:focus-visible { outline: 3px solid #000; outline-offset: 3px; }
.hxh-replay:focus-visible, .hx-chip:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.hx-demo-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hx-minidash { position: relative; }
.hx-minidash-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hx-minidash-col { background: #FFFFFF; border: 1px solid var(--hx-line); border-radius: 2px; padding: 12px; min-height: 150px; }
.hx-minidash-col h3 { margin: 0 0 10px; font-size: 0.64rem; letter-spacing: 0.12em; color: #6E6E6E; text-transform: uppercase; }
.hx-minidash-card {
  background: #FFFFFF; border: 1px solid var(--hx-line); border-radius: 2px; padding: 10px 12px;
  font-size: 0.78rem; color: #000; margin-bottom: 8px;
}
.hx-minidash-card strong { display: block; font-size: 0.82rem; }
.hx-minidash-card .meta { color: #6E6E6E; font-size: 0.68rem; margin-top: 3px; }
.hx-minidash-card.landed { border: 2px solid #000; animation: hx-land .5s ease; }
.hx-minidash-card .synced { color: #000; font-weight: 600; font-size: 0.7rem; margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.hx-minidash-card .synced::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #000; }
@keyframes hx-land { 0% { transform: translateY(-14px) scale(0.96); opacity: 0; } 100% { transform: none; opacity: 1; } }
.hx-tryit-toast {
  margin-top: 16px; background: #000000; color: #fff; border-radius: 2px; padding: 15px 18px;
  font-size: 0.92rem; display: none; align-items: center; gap: 12px;
}
.hx-tryit-toast.show { display: flex; animation: hx-land .4s ease; }
.hx-tryit-toast .hx-tick { flex: 0 0 22px; background: #fff; color: #000; }
.hx-tryit-reset { background: none; border: 0; color: #000; font-weight: 700; cursor: pointer; font-size: 0.86rem; padding: 8px 0; min-width: 44px; min-height: 44px; margin-top: 14px; text-decoration: underline; text-underline-offset: 3px; }
.hxp.completing { animation: hxp-complete .7s cubic-bezier(.6, 0, .4, 1) forwards; }
@keyframes hxp-complete {
  40% { transform: scale(0.97) rotate(0.5deg); }
  100% { transform: none; opacity: 1; }
}
.hxp.restored { animation: hxp-swap .35s ease; opacity: 1; transform: none; }

/* ---------- living dashboard ---------- */
.hxd { background: #000000; border-radius: 4px; padding: 2px; }
.hxd-frame { background: #F4F4F4; border-radius: 3px; overflow: hidden; }
.hxd-bar { background: #000000; display: flex; align-items: center; gap: 8px; padding: 10px 14px; }
.hxd-bar .d { width: 9px; height: 9px; border-radius: 50%; }
.hxd-url { min-width: 0; overflow-wrap: anywhere; background: #2E2E2E; color: #C9C9C9; font-size: 0.68rem; border-radius: 999px; padding: 4px 12px; margin-left: 8px; }
.hxd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px 4px; }
.hxd-head h3 { margin: 0; font-size: 1rem; color: #000; font-family: var(--wp--preset--font-family--heading); }
.hxd-live { display: inline-flex; align-items: center; gap: 6px; color: #000; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.hxd-live .dot { width: 7px; height: 7px; border-radius: 50%; background: #000; }
@keyframes hxd-blink { 50% { opacity: 0.25; } }
.hxd-clock { margin-left: auto; font-size: 0.78rem; color: #6E6E6E; font-variant-numeric: tabular-nums; }
.hxd-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 10px 14px 6px; }
.hxd-col { background: #FFFFFF; border: 1px solid #DDDDDD; border-radius: 2px; padding: 10px; min-height: 200px; }
.hxd-col h4 { margin: 0 0 8px; font-size: 0.6rem; letter-spacing: 0.12em; color: #6E6E6E; display: flex; justify-content: space-between; }
.hxd-card {
  background: #FFFFFF; border: 1px solid #DDDDDD; border-radius: 2px; padding: 8px 10px; margin-bottom: 7px;
  font-size: 0.72rem; color: #000; transition: transform .35s ease, opacity .35s ease;
}
.hxd-card strong { display: block; font-size: 0.76rem; }
.hxd-card .meta { color: #6E6E6E; font-size: 0.62rem; margin-top: 2px; }
.hxd-card .prog { height: 5px; border-radius: 0; background: #E4E4E4; margin-top: 6px; overflow: hidden; }
.hxd-card .prog i { display: block; height: 100%; background: #000; transition: width .8s ease; }
.hxd-card.busy { border: 1px solid #000; }
.hxd-card.enter { animation: hx-land .45s ease; }
.hxd-card.exit { opacity: 0; transform: translateY(8px); }
.hxd-feed { border-top: 1px solid #DDDDDD; margin-top: 4px; padding: 10px 16px 12px; background: #fff; }
.hxd-feed-title { font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: #6E6E6E; margin-bottom: 6px; }
.hxd-feed ul { list-style: none; margin: 0; padding: 0; }
.hxd-feed li { font-size: 0.74rem; color: #4A4A4A; padding: 3px 0; display: flex; gap: 10px; }
.hxd-feed li .t { color: #000; font-weight: 700; font-variant-numeric: tabular-nums; flex: 0 0 44px; }
.hxd-feed li.enter { animation: hx-land .4s ease; }

.hxd-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 10px 14px; border-top: 1px solid #DDDDDD; background: #fff; }
.hxd-toggle { min-width: 44px; min-height: 44px; padding: 9px 14px; border: 1px solid #000; border-radius: 2px; font: inherit; font-size: 0.82rem; font-weight: 600; background: #000; color: #fff; cursor: pointer; }
.hxd-status { color: #4A4A4A; font-size: 0.78rem; }
.hxd.is-paused .hxd-live .dot, .hxd.is-paused .hxd-card.enter, .hxd.is-paused .hxd-feed li.enter { animation: none; }
.hxd.is-paused .hxd-card { transition: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hx-tryit-grid { grid-template-columns: 1fr; }
  .hxh-stage { padding-left: 48px; }
  .hxh-paper { left: -8px; }
}
@media (max-width: 640px) {
  .hxh-stage { padding-left: 34px; }
  .hxh-paper { width: 150px; height: 200px; left: -10px; top: 16px; }
  .hxh-stage .hxp { width: 250px; margin-bottom: -70px; }
  .hx-minidash-cols, .hxd-cols { grid-template-columns: 1fr; }
  .hx-minidash-col, .hxd-col { min-height: 0; }
  .hxd-col.is-empty { display: none; }
  .hx-tryit-phone .hxp { width: 290px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hxh-fly, .hxh-replay { display: none !important; }
  .hxh-anim .hxh-paper { transition: none; }
  .hxp-check.pop, .hxp-chip.pulse, .hxp.completing, .hx-minidash-card.landed,
  .hx-tryit-toast.show, .hxd-card.enter, .hxd-feed li.enter, .hxp-swap { animation: none !important; }
  .hxd-live .dot { animation: none; }
  .hxp.completing { opacity: 1; }
}
