/* Live Tech design system for the product demos (products-demo/*).
   Same tokens as styles/landing.css: dark by default, light with [data-theme="light"].
   Holds the Live Tech bar on top of every demo and the shared app components. */

:root {
  color-scheme: dark;
  --accent: #3157F0;
  --accent-hover: #2848D8;
  --accent-text: #8EA3F7;
  --accent-soft: rgba(49, 87, 240, .16);
  --on-accent: #ffffff;

  --bg: #0d0d0f;
  --card: #131315;
  --card-2: #18181b;
  --text: #f4f4f4;
  --text-2: #b4b4b9;
  --dim: #8a8a8f;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --fill: rgba(255, 255, 255, .05);
  --fill-2: rgba(255, 255, 255, .08);

  --metal-a: #ffffff;
  --metal-b: #8b8b91;
  --mark-tint: linear-gradient(160deg, #7f98ff 0%, #3157F0 55%, #2443C4 100%);
  --glow: rgba(49, 87, 240, .22);
  --shadow: 0 30px 80px rgba(0, 0, 0, .5);
  --overlay: rgba(5, 5, 7, .72);

  --ok: #3ccf86;
  --ok-soft: rgba(60, 207, 134, .14);
  --warn: #f2b84b;
  --warn-soft: rgba(242, 184, 75, .14);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, .14);

  --font: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --bar-h: 68px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-opacity: .12;
}

:root[data-theme="light"] {
  color-scheme: light;
  --accent-text: #2C4ED8;
  --accent-soft: rgba(49, 87, 240, .1);
  --bg: #f5f5f7;
  --card: #ffffff;
  --card-2: #fbfbfc;
  --text: #0d0d0f;
  --text-2: #45454b;
  --dim: #6b6b71;
  --line: rgba(0, 0, 0, .08);
  --line-2: rgba(0, 0, 0, .16);
  --fill: rgba(0, 0, 0, .035);
  --fill-2: rgba(0, 0, 0, .06);
  --metal-a: #2a2a2f;
  --metal-b: #8a8a90;
  --glow: rgba(49, 87, 240, .12);
  --shadow: 0 30px 70px rgba(20, 30, 80, .14);
  --overlay: rgba(20, 22, 30, .4);
  --ok: #138a52;
  --ok-soft: rgba(19, 138, 82, .1);
  --warn: #a86a00;
  --warn-soft: rgba(168, 106, 0, .1);
  --bad: #d23c3c;
  --bad-soft: rgba(210, 60, 60, .1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-opacity: .06;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s ease, color .4s ease;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 220px;
  opacity: var(--grain-opacity);
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

/* ---------- Live Tech bar ---------- */
.lt-demobar {
  position: sticky;
  top: 0;
  z-index: 300;
  height: var(--bar-h);
  padding: 0 clamp(16px, 3vw, 32px);
  background: rgba(13, 13, 15, .9);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-family: var(--font);
  color: #f4f4f4;
}

:root[data-theme="light"] .lt-demobar {
  background: rgba(245, 245, 247, .86);
  border-bottom-color: rgba(0, 0, 0, .08);
  color: #0d0d0f;
}

.lt-demobar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1360px;
  height: 100%;
  margin: 0 auto;
}

.lt-demobar-left,
.lt-demobar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lt-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.03em;
  text-decoration: none;
  white-space: nowrap;
}

.lt-logo i {
  width: 24px;
  height: 24px;
  background: var(--mark-tint);
  -webkit-mask: url("../assets/livetech-mark.svg") center / contain no-repeat;
  mask: url("../assets/livetech-mark.svg") center / contain no-repeat;
}

.lt-sep {
  width: 1px;
  height: 22px;
  background: currentColor;
  opacity: .16;
}

.lt-product {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  opacity: .72;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lt-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.lt-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fbf71;
  box-shadow: 0 0 0 3px rgba(47, 191, 113, .2);
}

.lt-link,
.lt-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 18%, transparent);
  background: transparent;
  color: inherit;
  font: 600 13.5px/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .25s ease, background-color .25s ease;
}

.lt-theme {
  width: 38px;
  padding: 0;
}

.lt-link:hover,
.lt-theme:hover {
  border-color: color-mix(in srgb, currentColor 40%, transparent);
}

.lt-theme .ico-moon { display: none; }
:root[data-theme="light"] .lt-theme .ico-sun { display: none; }
:root[data-theme="light"] .lt-theme .ico-moon { display: block; }

.lt-link--cta {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.lt-link--cta:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ---------- Shared app components ---------- */
.ui-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.ui-title {
  margin: 0;
  font-size: clamp(30px, 3.6vw, 48px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.035em;
  color: var(--text);
}

.ui-title span {
  display: block;
  color: var(--dim);
}

.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font: 600 14.5px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .2s var(--ease);
}

.ui-btn:hover { border-color: var(--accent-text); }
.ui-btn:active { transform: translateY(1px); }

.ui-btn--primary {
  padding: 0 8px 0 20px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}

.ui-btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 4px var(--accent-soft);
}

.ui-btn--primary .ui-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  transition: transform .3s var(--ease);
}

.ui-btn--primary:hover .ui-dot { transform: rotate(90deg); }

.ui-btn--danger {
  border-color: var(--bad);
  background: var(--bad);
  color: #fff;
}

.ui-btn--danger:hover {
  border-color: var(--bad);
  box-shadow: 0 0 0 4px var(--bad-soft);
}

.ui-card {
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
}

.ui-input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--text);
  font: 400 14.5px/1 var(--font);
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
  box-sizing: border-box;
}

.ui-input::placeholder { color: var(--dim); }

.ui-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

select.ui-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8a8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

select.ui-input option {
  background: var(--card);
  color: var(--text);
}

input[type="date"].ui-input { color-scheme: inherit; }

.ui-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

.ui-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
}

.ui-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent);
}

.ui-status--ok { color: var(--ok); }
.ui-status--bad { color: var(--bad); }
.ui-status--warn { color: var(--warn); }
.ui-status--info { color: var(--accent-text); }

.ui-metal {
  background: linear-gradient(180deg, var(--metal-a) 15%, var(--metal-b) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ui-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--mark-tint);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}

@media (max-width: 760px) {
  .lt-badge,
  .lt-link--cta { display: none; }
}

@media (max-width: 480px) {
  .lt-sep,
  .lt-product { display: none; }
  .lt-link span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
