/* Shared demo chrome. Tokens are --d-* and scoped to .demo-bar / .demo-hub on
   purpose: demo apps define their own :root variables (--ink, --gold, ...) and a
   :root block here would silently override their theming. */
.demo-bar,
.demo-hub {
  --d-char: #35373b;
  --d-paper: #fbf9f5;
  --d-paper2: #ffffff;
  --d-ink: #21262c;
  --d-dim: #59616c;
  --d-faint: #6b7280;
  --d-line: rgba(33, 38, 44, .11);
  --d-line2: rgba(33, 38, 44, .2);
  --d-teal: #2f8b7c;
  --d-sky: #4f9cba;
  --d-olive: #93ad4e;
  --d-violet: #7b6a9e;
  --d-crim: #cb2c4d;
  --d-gold: #f0c33c;
}

/* ---------- the bar every demo carries ---------- */
.demo-bar {
  position: sticky;
  top: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 36px;
  box-sizing: border-box;
  padding: 6px clamp(12px, 3vw, 24px);
  background: var(--d-char);
  color: #fff;
  font: 600 11.5px/1.3 Karla, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.demo-bar a { color: #fff; text-decoration: none; }
.demo-bar a:hover { color: var(--d-gold); }
.demo-bar__name { font-weight: 700; }
.demo-bar__note {
  margin-left: auto;
  color: rgba(255, 255, 255, .72);
  font-weight: 500;
  letter-spacing: .01em;
  text-transform: none;
}
/* Both bar controls carry the 24px minimum target; on the float variant the
   back link is the only way out of the demo. */
.demo-bar__back,
.demo-bar__reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
}
.demo-bar__back { padding: 2px; }
.demo-bar__reset {
  border: 1.5px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  padding: 4px 10px;
  font: inherit;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.demo-bar__reset:hover { border-color: var(--d-gold); color: var(--d-gold); }
.demo-bar :focus-visible { outline: 2px solid var(--d-gold); outline-offset: 2px; border-radius: 4px; }

/* Floating variant for kiosk / 100vh layouts that cannot give up top space. */
.demo-bar--float {
  position: fixed;
  top: auto;
  bottom: 12px;
  left: 12px;
  right: auto;
  width: auto;
  min-height: 0;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}

@media (max-width: 620px) {
  /* The full note does not fit on a phone, but the privacy claim is the line
     worth keeping, so stand a short one in its place rather than hiding it. */
  .demo-bar__note { visibility: hidden; font-size: 0; }
  .demo-bar__note::after {
    content: "Demo " "\00b7" " nothing leaves your browser";
    visibility: visible;
    font-size: 10.5px;
    white-space: nowrap;
  }
}
@media print {
  .demo-bar { display: none !important; }
}

/* ---------- the hub page ---------- */
.demo-hub {
  margin: 0;
  background: var(--d-paper);
  color: var(--d-ink);
  font-family: Karla, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}
.demo-hub *,
.demo-hub *::before,
.demo-hub *::after { box-sizing: border-box; }
.demo-hub__shell { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 3rem); }
.demo-hub__head { padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(1.5rem, 3vw, 2.2rem); display: grid; justify-items: center; gap: 14px; text-align: center; }
.demo-hub__eyebrow { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--d-teal); }
.demo-hub__title { margin: 0; font-family: Poppins, sans-serif; font-weight: 600; font-size: clamp(1.9rem, 4.4vw, 3.1rem); line-height: 1.12; letter-spacing: -.015em; }
.demo-hub__lede { margin: 0; max-width: 56ch; color: var(--d-dim); font-size: .98rem; line-height: 1.6; }
.demo-hub__back {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px;
  padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--d-line2);
  color: var(--d-dim); text-decoration: none;
  font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  transition: border-color .25s ease, color .25s ease;
}
.demo-hub__back:hover { border-color: var(--d-ink); color: var(--d-ink); }
.demo-hub__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 14px; padding-bottom: clamp(3rem, 6vw, 5rem); }
.demo-card {
  display: grid; align-content: start; gap: 10px;
  padding: clamp(1.3rem, 2.2vw, 1.7rem);
  border-radius: 20px; border: 1px solid var(--d-line);
  background: var(--d-paper2);
  transition: transform .45s cubic-bezier(.22, 1, .36, 1), border-color .3s ease;
}
.demo-card:hover { transform: translateY(-4px); border-color: var(--d-line2); }
.demo-card__kicker { font-size: 10.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.demo-card__kicker--sky { color: var(--d-sky); }
.demo-card__kicker--olive { color: var(--d-olive); }
.demo-card__kicker--violet { color: var(--d-violet); }
.demo-card__kicker--crim { color: var(--d-crim); }
.demo-card__kicker--teal { color: var(--d-teal); }
.demo-card h2 { margin: 0; font-family: Poppins, sans-serif; font-size: 1.1rem; font-weight: 600; }
.demo-card p { margin: 0; font-size: .94rem; line-height: 1.6; color: var(--d-dim); }
.demo-card__built { font-size: .88rem !important; line-height: 1.55 !important; color: var(--d-teal) !important; font-weight: 600; }
.demo-card__cta {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  padding: 10px 18px; border-radius: 999px; background: var(--d-gold); color: var(--d-ink);
  text-decoration: none; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}
.demo-card__cta:hover { transform: translateY(-2px); }
.demo-hub__foot { padding-bottom: clamp(2.5rem, 5vw, 4rem); text-align: center; font-size: .9rem; color: var(--d-faint); }

/* A card with more than one action. */
.demo-card__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.demo-card__actions .demo-card__cta { margin-top: 0; }
.demo-card__cta--ghost {
  background: transparent;
  border: 1.5px solid var(--d-line2);
  color: var(--d-dim);
  transition: border-color .25s ease, color .25s ease, transform .3s cubic-bezier(.22, 1, .36, 1);
}
.demo-card__cta--ghost:hover { border-color: var(--d-ink); color: var(--d-ink); }

/* The pills suppress the UA focus ring against the paper background, so the hub
   states its own. Ghost CTAs carry .demo-card__cta too, so they are covered. */
.demo-hub__back:focus-visible,
.demo-card__cta:focus-visible { outline: 2px solid var(--d-ink); outline-offset: 3px; }

/* Hover lifts are decoration; nobody who asked for less motion needs them. */
@media (prefers-reduced-motion: reduce) {
  .demo-card,
  .demo-card__cta,
  .demo-hub__back,
  .demo-bar__reset { transition: none; }
  .demo-card:hover,
  .demo-card__cta:hover { transform: none; }
}
