/* Shared by every sector demo: fonts, the «Demo» ribbon, the WhatsApp phone and a few resets.
   Each demo brings its own colours through the variables in its style.css. */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/vendor/fonts/jakarta-latin.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/vendor/fonts/fraunces-latin.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: #0E0D14;
  color: #fff;
}

.skip:focus {
  top: 12px;
}

/* «Demo» ribbon: DaniMartin.dev colours, so it never looks like part of the business. */
.demo-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 18px;
  padding: 10px 20px;
  background: #0E0D14;
  color: #F2F0FF;
  font: 500 14px/1.4 'Plus Jakarta Sans', system-ui, sans-serif;
  text-align: center;
}

.demo-ribbon p {
  margin: 0;
}

.demo-ribbon strong {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #2563EB;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.demo-ribbon a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* WhatsApp phone, seen from the customer's side: their messages on the right, the business on the left. */
.wa-phone {
  width: min(340px, 100%);
  margin-inline: auto;
  padding: 11px;
  border-radius: 46px;
  background: #121212;
  box-shadow: 0 40px 80px -40px rgba(10, 20, 30, 0.55), inset 0 0 0 2px #2B2B2B;
}

.wa-screen {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 600px;
  overflow: hidden;
  border-radius: 36px;
  background: #EFEAE2;
  font: 400 14.5px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #111B21;
}

.wa-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 12px;
  background: #075E54;
  color: #fff;
}

.wa-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--wa-avatar, #25D366);
  font-weight: 700;
}

.wa-name {
  display: block;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
}

.wa-status {
  display: block;
  font-size: 12px;
  opacity: 0.85;
}

.wa-chat {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 12px;
  overflow-y: auto;
  scrollbar-width: none;
  background-color: #EFEAE2;
  background-image: radial-gradient(rgba(17, 27, 33, 0.05) 1px, transparent 1px);
  background-size: 14px 14px;
}

.wa-chat::-webkit-scrollbar {
  display: none;
}

.wa-day {
  align-self: center;
  margin: 4px 0;
  padding: 4px 10px;
  border-radius: 8px;
  background: #E1F3FB;
  color: #3B5563;
  font-size: 12px;
}

.wa-msg {
  position: relative;
  max-width: 84%;
  padding: 7px 9px 5px;
  border-radius: 10px;
  box-shadow: 0 1px 1px rgba(17, 27, 33, 0.1);
}

.wa-msg p {
  margin: 0;
}

.wa-msg p + p {
  margin-top: 4px;
}

.wa-me {
  align-self: flex-end;
  border-top-right-radius: 3px;
  background: #D9FDD3;
}

.wa-them {
  align-self: flex-start;
  border-top-left-radius: 3px;
  background: #fff;
}

.wa-time {
  display: block;
  margin-top: 2px;
  color: #667781;
  font-size: 11px;
  text-align: right;
}

.wa-ok {
  color: #008069;
  font-weight: 600;
}

.wa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 7px 0 3px;
}

.wa-chips span {
  padding: 5px 10px;
  border: 1px solid #CBE7F5;
  border-radius: 999px;
  background: #F5FBFE;
  color: #027EB5;
  font-size: 13px;
  font-weight: 600;
}

.wa-doc {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 3px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(17, 27, 33, 0.06);
  font-size: 13.5px;
}

.wa-doc svg {
  flex: none;
}

.wa-doc small {
  display: block;
  color: #667781;
  font-size: 11.5px;
}

.wa-typing {
  display: flex;
  gap: 4px;
  align-self: flex-start;
  padding: 11px 13px;
  border-radius: 10px;
  border-top-left-radius: 3px;
  background: #fff;
}

.wa-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8696A0;
  animation: wa-dot 1s infinite ease-in-out;
}

.wa-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.wa-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes wa-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.wa-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 16px;
  background: #F0F2F5;
}

.wa-field {
  flex: 1;
  padding: 9px 14px;
  border-radius: 999px;
  background: #fff;
  color: #8696A0;
}

.wa-mic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #00A884;
}

/* With JavaScript the conversation plays message by message; without it, it is all there. */
.wa-playing [data-step] {
  display: none;
}

.wa-playing [data-step].is-on {
  display: flex;
  animation: wa-in 0.35s ease-out;
}

.wa-playing .wa-msg[data-step].is-on {
  display: block;
}

@keyframes wa-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.wa-new {
  animation: wa-in 0.35s ease-out;
}

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

/* Fade-in on scroll: demo.js only hides what is still below the fold. */
.reveal-wait {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal-wait.reveal-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .wa-typing span,
  .wa-new,
  .wa-playing [data-step].is-on {
    animation: none;
  }
}
