/* Shared parts of the /concepts sites: the FlowWays concept bar, reveal-on-scroll and the
   text-message demos. Each site colours these through the --cx-* variables in its site.css. */

:root {
  --cx-ink: #111;
  --cx-paper: #fff;
  --cx-accent: #1f5eff;
  --cx-on-accent: #fff;
  --cx-phone: #0d0d0f;
  --cx-in: #e9e9ec;
  --cx-in-ink: #111;
  --cx-font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.cx-bar {
  position: relative;
  z-index: 60;
  background: #0b0b0c;
  color: #ececec;
  font: 500 12px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .02em;
}
.cx-bar-in {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: center;
  justify-content: space-between;
}
.cx-bar b { font-weight: 600; }
.cx-bar nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.cx-bar a { color: #a9c0ff; text-underline-offset: 2px; }
.cx-bar a:hover { color: #fff; }

.cx-vh {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Generated images carry this caption so nobody mistakes them for a real business's photos. */
.cx-gen {
  font: 500 11px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .04em;
  opacity: .72;
}

/* Reveal on scroll. Without JS everything stays visible. */
.cx-js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--d, 0s);
}
.cx-js [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .cx-js [data-reveal] { transform: none; transition: opacity 1.8s ease; }
}

/* Phone with a text thread (missed-call text back, review request). */
.cx-phone {
  width: min(320px, 100%);
  margin: 0 auto;
  padding: 12px;
  border-radius: 44px;
  background: var(--cx-phone);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.cx-screen {
  border-radius: 33px;
  background: var(--cx-paper);
  color: var(--cx-ink);
  min-height: 460px;
  padding: 18px 14px 20px;
  font: 14px/1.4 var(--cx-font);
  display: flex;
  flex-direction: column;
}
.cx-screen-head {
  text-align: center;
  font-size: 12px;
  opacity: .7;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--cx-ink) 12%, transparent);
}
.cx-screen-head b { display: block; font-size: 14px; opacity: 1; color: var(--cx-ink); }
.cx-thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cx-msg {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 18px;
}
.cx-out { align-self: flex-end; background: var(--cx-accent); color: var(--cx-on-accent); border-bottom-right-radius: 5px; }
.cx-in { align-self: flex-start; background: var(--cx-in); color: var(--cx-in-ink); border-bottom-left-radius: 5px; }
.cx-sys { align-self: center; max-width: none; padding: 2px 0; font-size: 12px; opacity: .65; }
.cx-msg small { display: block; font-size: 11px; opacity: .7; margin-top: 3px; }
.cx-stars { letter-spacing: 2px; color: #f5b301; }

.cx-js .cx-msg { opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .35s ease, transform .35s ease; }
.cx-js .cx-msg.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .cx-js .cx-msg { transform: none; transition: opacity .8s ease; }
}
/* Incoming message shows three dots before its text lands. */
.cx-js .cx-msg.typing { opacity: 1; transform: none; color: transparent; position: relative; min-height: 34px; min-width: 58px; }
.cx-js .cx-msg.typing > * { visibility: hidden; }
.cx-msg.typing::after {
  content: "";
  position: absolute;
  left: 14px; top: 50%;
  width: 6px; height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--cx-in-ink);
  opacity: .5;
  box-shadow: 10px 0 0 var(--cx-in-ink), 20px 0 0 var(--cx-in-ink);
  animation: cx-dots 1s infinite alternate;
}
@keyframes cx-dots { to { opacity: .15; } }
@media (prefers-reduced-motion: reduce) {
  .cx-msg.typing::after { animation-duration: 2.5s; }
}
.cx-replay {
  margin-top: auto;
  align-self: center;
  border: 1px solid color-mix(in srgb, var(--cx-ink) 25%, transparent);
  background: none;
  color: var(--cx-ink);
  font: 500 12px/1 var(--cx-font);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.cx-replay[hidden] { display: none; }
