/* ── demo.css — the Samatva frame around the dashboard ─────────────────
   The bar, drawer and tour belong to the studio, not to the product, so
   they speak the site's language: void ground, chrome type, DM Mono for
   the machine voice, Instrument Serif for the human one, and the two
   accents (cool / warm) only ever as light — hairlines and glows. The
   dashboard underneath keeps its own look, because it is the product.
   Every token is prefixed --s- so nothing leaks into the dashboard. */

:root {
  --s-void: #08080a;
  --s-graphite: #101216;
  --s-steel: #23262c;
  --s-chrome: #e8eaee;
  --s-body: #b9bec7;
  --s-dim: #8f959f;
  --s-faint: #5c626c;
  --s-cool: #9db4cc;
  --s-warm: #d6bfa3;
  --s-serif: 'Instrument Serif', Georgia, serif;
  --s-mono: 'DM Mono', ui-monospace, Menlo, monospace;
  --s-sans: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --s-ease: cubic-bezier(.16, 1, .3, 1);
  --s-bar-h: 48px;
}

/* ── Bar ─────────────────────────────────────────────────────────────── */

.demo-bar {
  position: sticky;
  top: 0;
  z-index: 101;
  height: var(--s-bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: var(--s-void);
  color: var(--s-chrome);
  font-family: var(--s-sans);
  flex-shrink: 0;
}
/* One line of light along the bottom edge: cool camera-left, warm right.
   It leans warm when the store is under pressure. */
.demo-bar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--s-cool) 22%, var(--s-steel) 50%, var(--s-warm) 78%, transparent 100%);
  opacity: .5;
  transition: opacity .6s var(--s-ease);
}
html[data-demo-scenario="pressure"] .demo-bar::after {
  background: linear-gradient(90deg, transparent 0%, var(--s-steel) 22%, var(--s-warm) 60%, var(--s-warm) 80%, transparent 100%);
  opacity: .7;
}

/* The dashboard's sticky header stacks under the bar. */
.demo-bar ~ .app-header { top: var(--s-bar-h); }

.demo-bar-left, .demo-bar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.demo-bar-right { gap: 8px; flex-shrink: 0; }

.demo-home {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--s-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--s-dim); text-decoration: none;
  padding: 6px 12px 6px 0;
  border-right: 1px solid var(--s-steel);
  transition: color .2s;
}
.demo-home:hover { color: var(--s-chrome); }

.demo-store {
  font-size: 13.5px; font-weight: 500; letter-spacing: .01em; color: var(--s-chrome);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}

.demo-tag {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  font-family: var(--s-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--s-faint);
}
.demo-tag i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--s-cool);
  box-shadow: 0 0 8px var(--s-cool);
  transition: background .6s, box-shadow .6s;
}
html[data-demo-scenario="pressure"] .demo-tag i { background: var(--s-warm); box-shadow: 0 0 8px var(--s-warm); }

/* Scenario: a two-state radio group */
.demo-scenario {
  display: inline-flex; padding: 2px; gap: 2px;
  border: 1px solid var(--s-steel); border-radius: 999px;
}
.demo-scenario button {
  font-family: var(--s-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--s-dim); background: transparent; border: 0; border-radius: 999px;
  padding: 6px 12px; cursor: pointer; white-space: nowrap;
  transition: color .2s, background .2s, box-shadow .3s;
}
.demo-scenario button:hover { color: var(--s-chrome); }
.demo-scenario button[aria-checked="true"] {
  color: var(--s-chrome);
  background: rgba(232, 234, 238, .07);
  box-shadow: inset 0 0 0 1px rgba(157, 180, 204, .4);
}
.demo-scenario button[data-scenario="pressure"][aria-checked="true"] { box-shadow: inset 0 0 0 1px rgba(214, 191, 163, .5); }

/* Buttons */
.demo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--s-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--s-chrome); background: transparent;
  border: 1px solid var(--s-steel); border-radius: 999px;
  padding: 7px 13px; cursor: pointer; white-space: nowrap;
  transition: border-color .2s, background .2s, color .2s;
}
.demo-btn:hover { border-color: #3a3e46; background: rgba(232, 234, 238, .04); }
.demo-btn:disabled { opacity: .35; cursor: default; }
.demo-btn-primary { background: var(--s-chrome); color: var(--s-void); border-color: var(--s-chrome); }
.demo-btn-primary:hover { background: #fff; border-color: #fff; }
.demo-btn-quiet { border-color: transparent; color: var(--s-dim); padding-left: 4px; padding-right: 4px; }
.demo-btn-quiet:hover { border-color: transparent; background: transparent; color: var(--s-chrome); }

.demo-icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--s-steel); border-radius: 50%;
  background: transparent; color: var(--s-dim); cursor: pointer;
  transition: color .2s, border-color .2s;
}
.demo-icon-btn:hover { color: var(--s-chrome); border-color: #3a3e46; }

.demo-bar :focus-visible, .demo-drawer :focus-visible, .demo-tour :focus-visible {
  outline: 2px solid var(--s-cool); outline-offset: 2px;
}

/* Shared type */
.demo-kicker {
  font-family: var(--s-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--s-faint); margin: 0 0 10px;
}

/* ── Make it yours ───────────────────────────────────────────────────── */

.demo-drawer { position: fixed; inset: 0; z-index: 300; }
.demo-drawer[hidden] { display: none; }
.demo-drawer-scrim {
  position: absolute; inset: 0; background: rgba(8, 8, 10, .62);
  opacity: 0; transition: opacity .26s var(--s-ease);
}
.demo-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(440px, 100vw);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 28px 24px;
  background: var(--s-graphite);
  border-left: 1px solid var(--s-steel);
  color: var(--s-chrome); font-family: var(--s-sans);
  transform: translateX(28px); opacity: 0;
  transition: transform .32s var(--s-ease), opacity .26s var(--s-ease);
}
.demo-drawer.is-open .demo-drawer-scrim { opacity: 1; }
.demo-drawer.is-open .demo-drawer-panel { transform: none; opacity: 1; }

.demo-drawer-head { position: relative; padding-right: 44px; }
.demo-drawer-head .demo-icon-btn { position: absolute; top: -4px; right: 0; }
.demo-drawer-title {
  font-family: var(--s-serif); font-weight: 400; font-size: 38px; line-height: 1.02;
  letter-spacing: -.01em; color: var(--s-chrome); margin: 0;
}
.demo-drawer-title em { font-style: italic; color: var(--s-body); }
.demo-drawer-lead { font-size: 14px; line-height: 1.55; color: var(--s-dim); margin: 14px 0 26px; max-width: 34em; }

.demo-label {
  display: block;
  font-family: var(--s-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--s-dim); margin-bottom: 8px; padding: 0;
}
.demo-field { display: block; margin-bottom: 24px; }
.demo-field input,
.demo-targets input {
  width: 100%;
  background: var(--s-void); color: var(--s-chrome);
  border: 1px solid var(--s-steel); border-radius: 10px;
  font-family: var(--s-sans); font-size: 15px;
  padding: 10px 12px;
  transition: border-color .2s, box-shadow .2s;
}
.demo-field input:focus, .demo-targets input:focus {
  outline: none; border-color: var(--s-cool); box-shadow: 0 0 0 3px rgba(157, 180, 204, .14);
}
.demo-targets { border: 0; padding: 0; margin: 0; min-width: 0; }
.demo-targets-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}
.demo-targets-col {
  font-family: var(--s-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--s-faint); text-align: center;
}
.demo-targets-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 6px 0; }
.demo-targets-name { font-size: 13.5px; color: var(--s-chrome); }
.demo-targets-hint { font-family: var(--s-mono); font-size: 9.5px; letter-spacing: .04em; color: var(--s-faint); line-height: 1.35; }
.demo-targets input {
  font-family: var(--s-mono); font-size: 13px; text-align: center;
  padding: 9px 4px; border-radius: 8px;
  -moz-appearance: textfield; appearance: textfield;
}
.demo-targets input::-webkit-outer-spin-button,
.demo-targets input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.demo-targets input[aria-invalid="true"] { border-color: var(--s-warm); box-shadow: 0 0 0 3px rgba(214, 191, 163, .12); }

.demo-form-error { min-height: 1.5em; margin: 14px 0 0; font-size: 13px; line-height: 1.45; color: var(--s-warm); }
.demo-drawer-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--s-steel);
}

/* ── Tour ────────────────────────────────────────────────────────────── */
/* The spotlight is a hole cut by its own shadow. The layer ignores the
   pointer so the page under it stays usable; only the card takes clicks. */

.demo-tour { position: fixed; inset: 0; z-index: 400; pointer-events: none; transition: background .3s; }
.demo-tour[hidden] { display: none; }
.demo-tour.is-dim { background: rgba(8, 8, 10, .5); }

.demo-tour-spot {
  position: fixed; border-radius: 14px;
  box-shadow: 0 0 0 200vmax rgba(8, 8, 10, .6), inset 0 0 0 1px rgba(232, 234, 238, .55), 0 0 24px rgba(157, 180, 204, .25);
  transition: top .45s var(--s-ease), left .45s var(--s-ease), width .45s var(--s-ease), height .45s var(--s-ease), opacity .3s;
}

.demo-tour-card {
  position: fixed;
  width: min(380px, calc(100vw - 24px));
  pointer-events: auto;
  padding: 20px 22px 16px;
  background: var(--s-graphite);
  border: 1px solid var(--s-steel);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  color: var(--s-chrome); font-family: var(--s-sans);
  transition: top .45s var(--s-ease), left .45s var(--s-ease);
}
.demo-tour-card::before {
  content: ''; position: absolute; left: 18px; right: 18px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--s-cool) 30%, var(--s-warm) 70%, transparent);
  opacity: .6;
}
.demo-tour-card.is-docked {
  top: auto !important; bottom: 12px;
  left: 12px !important; right: 12px;
  width: auto; max-width: 520px; margin: 0 auto;
}
.demo-tour-title {
  font-family: var(--s-serif); font-weight: 400; font-size: 26px; line-height: 1.1;
  letter-spacing: -.005em; margin: 0 0 10px; color: var(--s-chrome);
}
.demo-tour-body { font-size: 14px; line-height: 1.6; color: var(--s-body); margin: 0; }
.demo-tour-title, .demo-tour-body { transition: opacity .3s var(--s-ease), transform .45s var(--s-ease); }
.demo-tour-card.is-entering .demo-tour-title,
.demo-tour-card.is-entering .demo-tour-body { opacity: 0; transform: translateY(4px); transition: none; }
.demo-tour-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 18px; }
.demo-tour-nav { display: inline-flex; gap: 8px; }

/* ── Small screens ───────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .demo-bar { padding: 0 12px; gap: 10px; }
  .demo-tag-text, .demo-home span,
  .demo-bar .demo-btn > span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .demo-home { padding-right: 8px; }
  .demo-bar .demo-btn { width: 34px; height: 34px; padding: 0; }
  .demo-scenario button { padding: 6px 10px; font-size: 10.5px; letter-spacing: .06em; }
}

@media (max-width: 640px) {
  .demo-drawer-panel {
    top: auto; left: 0; width: 100%; max-height: 90vh;
    border-left: 0; border-top: 1px solid var(--s-steel); border-radius: 18px 18px 0 0;
    padding: 24px 18px 18px;
    transform: translateY(32px);
  }
  .demo-drawer-title { font-size: 32px; }
  .demo-targets-grid { grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr)); gap: 6px; }
}

.demo-short { display: none; }

@media (max-width: 480px) {
  .demo-long { display: none; }
  .demo-short { display: inline; }
}

@media (max-width: 400px) {
  .demo-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-bar::after, .demo-tag i, .demo-scenario button,
  .demo-drawer-scrim, .demo-drawer-panel,
  .demo-tour, .demo-tour-spot, .demo-tour-card,
  .demo-tour-title, .demo-tour-body { transition: none !important; }
}
