/* ==========================================================================
   Krisp widget demo (/demo)

   Two voices on one page, on purpose:
     - "Quillfield", a fictional shop with its own cool-green look, standing in
       for a customer's website;
     - Krisp's own warm paper + amber for the strip at the top, the setup
       form and the "Behind this demo" panel.
   The chat launcher and iframe are added by the real loader script and are
   not styled here.
   ========================================================================== */

:root {
  /* Quillfield */
  --shop-bg: #F4F5F0;
  --shop-card: #FFFFFF;
  --shop-ink: #17231F;
  --shop-muted: #56635D;      /* 5.9:1 on --shop-bg */
  --shop-line: #D9DDD3;
  --shop-green: #1E4D40;
  --shop-green-dark: #163A30;
  --shop-clay: #B4552D;

  /* Krisp */
  --cc-dark: #2A2723;
  --cc-paper: #FBF7EF;
  --cc-card: #FFFEFC;
  --cc-ink: #1F2421;
  --cc-muted: #66655C;
  --cc-border: #E2D9C8;
  --cc-control: #948974;
  --cc-amber: #C8853F;
  --cc-amber-ink: #8A5413;
  --cc-danger: #A63A28;
  --cc-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --pad: 20px;
  color-scheme: light;
}

@media (min-width: 768px) {
  :root { --pad: 32px; }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--shop-bg);
  color: var(--shop-ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, dl, dd, pre {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
}

button, input {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--shop-green);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--cc-card);
  color: var(--cc-ink);
  font-weight: 600;
}

.skip:focus {
  top: 12px;
}

/* -- Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

@media (pointer: coarse) {
  .btn-small { min-height: 44px; }
}

.btn-green {
  background: var(--shop-green);
  color: #fff;
}

.btn-green:hover {
  background: var(--shop-green-dark);
}

.btn-line {
  background: transparent;
  color: var(--shop-ink);
  box-shadow: inset 0 0 0 1.5px var(--shop-ink);
}

.btn-line:hover {
  background: var(--shop-ink);
  color: #fff;
}

.btn-line.is-added {
  background: var(--shop-green);
  color: #fff;
  box-shadow: none;
}

.btn-amber {
  background: var(--cc-amber);
  color: var(--cc-ink);
  box-shadow: inset 0 0 0 1px rgba(31, 36, 33, 0.12);
}

.btn-amber:hover {
  background: #D2914B;
}

.btn-amber:focus-visible {
  outline-color: var(--cc-amber-ink);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* -- Krisp strip ------------------------------------------------------ */

.demo-bar {
  flex: none;
  background: var(--cc-dark);
  color: #F6F1E8;
  font-size: 13.5px;
  line-height: 1.4;
}

.demo-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px var(--pad);
}

.demo-mark {
  flex: none;
}

.demo-bar-text {
  flex: 1 1 260px;
  min-width: 0;
}

.demo-bar-text strong {
  font-weight: 600;
  color: #fff;
  overflow-wrap: anywhere;
}

.demo-bar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.demo-bar-links a,
.demo-bar-links button {
  color: #E0A560;
  font-weight: 600;
  text-underline-offset: 3px;
  padding: 4px 0;
}

.demo-bar-links button {
  background: none;
  border: 0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.demo-bar-links a:hover,
.demo-bar-links button:hover {
  color: #fff;
}

.demo-bar :focus-visible {
  outline-color: #E0A560;
}

/* -- Boot ------------------------------------------------------------------ */

.boot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px var(--pad);
  color: var(--shop-muted);
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--shop-line);
  border-top-color: var(--shop-green);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.noscript {
  margin: 0;
  padding: 24px var(--pad);
  text-align: center;
}

/* -- Setup (Krisp voice) --------------------------------------------- */

.setup {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px var(--pad) 64px;
  background: #F6F1E8;
  color: var(--cc-ink);
}

.setup-card {
  width: 100%;
  max-width: 460px;
  padding: 28px;
  border-radius: 14px;
  background: var(--cc-card);
  border: 1px solid var(--cc-border);
  box-shadow: 0 2px 4px rgba(42, 39, 35, 0.06), 0 12px 32px rgba(42, 39, 35, 0.1);
}

@media (min-width: 520px) {
  .setup-card { padding: 36px; }
}

.eyebrow {
  color: var(--cc-amber-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.setup-title {
  margin-top: 8px;
  font-family: var(--cc-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.setup-text {
  margin-top: 10px;
  color: var(--cc-muted);
  font-size: 15px;
  text-wrap: pretty;
}

.label {
  display: block;
  margin: 22px 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--cc-control);
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input::placeholder {
  color: #74716A;
}

.input:focus-visible {
  outline: none;
  border-color: var(--cc-amber-ink);
  box-shadow: 0 0 0 3px rgba(200, 133, 63, 0.32);
}

.input[aria-invalid="true"] {
  border-color: var(--cc-danger);
}

.hint {
  margin-top: 6px;
  color: var(--cc-muted);
  font-size: 13px;
}

.error {
  margin-top: 8px;
  color: var(--cc-danger);
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.setup-card .btn {
  width: 100%;
  margin-top: 20px;
}

/* -- Shop ------------------------------------------------------------------ */

.shop {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.shop-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.shop-head {
  border-bottom: 1px solid var(--shop-line);
  background: var(--shop-bg);
}

.shop-head-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
}

.shop-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--shop-green);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  border-radius: 6px;
}

.shop-nav {
  display: none;
  gap: 28px;
  margin-right: 12px;
  font-size: 15px;
  font-weight: 500;
}

@media (min-width: 720px) {
  .shop-nav { display: flex; }
}

.shop-nav a {
  padding: 8px 0;
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: border-color 160ms ease;
}

.shop-nav a:hover {
  border-color: var(--shop-ink);
}

.shop-basket {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 6px 0 14px;
  border-radius: 999px;
  background: var(--shop-card);
  box-shadow: inset 0 0 0 1px var(--shop-line);
  font-size: 14px;
  font-weight: 600;
}

.shop-basket-count {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--shop-green);
  color: #fff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* Hero */

.hero {
  padding: 40px 0 16px;
}

.hero-inner {
  display: grid;
  gap: 24px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero { padding: 64px 0 32px; }
  .hero-inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 48px; }
}

.shop-eyebrow {
  color: var(--shop-clay);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title {
  margin-top: 12px;
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-text {
  max-width: 46ch;
  margin-top: 18px;
  color: var(--shop-muted);
  font-size: 18px;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-art {
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}

/* Products */

.products {
  padding: 40px 0 56px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-note {
  color: var(--shop-muted);
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--shop-card);
  box-shadow: inset 0 0 0 1px var(--shop-line);
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 0 0 1px var(--shop-line), 0 14px 30px rgba(23, 35, 31, 0.1);
}

.card-art {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
}

.card-art svg {
  width: 100%;
  height: 100%;
}

.tint-sage { background: #DDE5DA; }
.tint-sand { background: #EFE6D2; }
.tint-clay { background: #F0DDD2; }
.tint-mist { background: #DEE6E8; }

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 18px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-text {
  margin-top: 4px;
  color: var(--shop-muted);
  font-size: 14.5px;
}

.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}

.price {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Service strip */

.service {
  padding: 40px 0;
  background: var(--shop-green);
  color: #F4F5F0;
}

.service-grid {
  display: grid;
  gap: 28px;
}

@media (min-width: 760px) {
  .service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
}

.service-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.service-text {
  margin-top: 6px;
  color: #D5E0DA;
  font-size: 15px;
}

.shop-foot {
  padding: 24px 0;
  color: var(--shop-muted);
  font-size: 14px;
}

/* -- Behind this demo (Krisp voice) ---------------------------------- */

.embed {
  /* Room for the launcher button, which sits fixed in the corner. */
  padding: 48px var(--pad) 120px;
  background: var(--cc-paper);
  border-top: 1px solid var(--cc-border);
  color: var(--cc-ink);
}

.embed-inner {
  max-width: 760px;
  margin: 0 auto;
}

.embed-title {
  margin-top: 8px;
  font-family: var(--cc-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.embed-text {
  margin-top: 12px;
  max-width: 62ch;
  color: #454A44;
  text-wrap: pretty;
}

.embed code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #EFE8DA;
  font-family: var(--mono);
  font-size: 0.9em;
}

.embed :focus-visible {
  outline-color: var(--cc-amber-ink);
}

.snippet {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 14px 14px 18px;
  border-radius: 12px;
  background: var(--cc-dark);
  color: #F6F1E8;
}

.snippet-code {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 4px;
}

.snippet-code:focus-visible {
  outline-color: #E0A560;
}

.snippet .btn {
  flex: none;
  min-width: 82px;
}

.snippet .btn:focus-visible {
  outline-color: #E0A560;
}

@media (max-width: 519px) {
  .snippet { flex-direction: column; align-items: stretch; padding: 14px; }
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  font-size: 15px;
}

.options > div {
  display: grid;
  gap: 2px 16px;
}

@media (min-width: 560px) {
  .options > div { grid-template-columns: 150px minmax(0, 1fr); align-items: baseline; }
}

.options dd {
  color: #454A44;
}

.embed-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 24px;
  font-size: 15px;
}

.embed-links a {
  color: var(--cc-amber-ink);
  font-weight: 600;
  text-underline-offset: 3px;
  padding: 4px 0;
}

.embed-links a:hover {
  color: var(--cc-ink);
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
  }

  .card:hover { transform: none; }
  .spinner { animation-duration: 1.6s; }
}

/* Touch: every link in the demo chrome is at least 44px tall. */
@media (pointer: coarse) {
  .demo-bar-links a,
  .embed-links a,
  .shop-logo {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
