/* Signal for the live demos: the five demo pages and /use-cases/.
   Loads after site.css, demos.css and the per-demo sheet. The demo apps become instruments: an ink title bar,
   hairline panels, mono labels, orange primary actions, hard offset shadows, crisp corners. Colour comes from the
   tone variables; the old demo variables are re-pointed here so the per-demo sheets pick up Signal without edits. */

/* ── Re-point the legacy variables the demo sheets still read ── */
.demo-section, .demo, .st {
  --sea: var(--ink); --sea-2: var(--sun); --sea-soft: var(--sun-soft);
  --night: var(--ink); --line: rgba(14, 27, 42, .16); --line-2: rgba(14, 27, 42, .42);
  --radius: 5px; --radius-sm: 4px; --muted: #4f5966;
  --shadow: none; --shadow-lg: none;
}

/* ── Demo pages: bigger headline, calm hero ── */
.page-demo .page-hero h1 { font-size: clamp(2.3rem, 5.2vw, 4.6rem); max-width: 17em; line-height: .96; }
.page-demo .page-hero .lede { font-size: clamp(1.05rem, 1.5vw, 1.25rem); max-width: 46em; margin-top: 1.1rem; }
.page-demo .page-hero { padding-bottom: 96px; }
.page-demo .flow-strip { margin-top: 1.6rem; }

/* ── The instrument frame ── */
.demo-section { margin-top: -3.25rem; }
.demo {
  background: var(--surface); color: var(--ink); border: 2px solid var(--ink); border-radius: 6px;
  box-shadow: 8px 8px 0 var(--sun); overflow: hidden;
}
.demo-bar {
  padding: .8rem 1.25rem; gap: .5rem 1.5rem; background: var(--sun); color: var(--ink); border-bottom: 2px solid var(--ink);
}
.demo-bar-title { font: 500 .8rem/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); gap: .85rem; }
.demo-bar .pill { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.demo-bar-note { font: 500 .72rem/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--ink); }
.demo-in { border-right: 1px solid var(--ink); background: var(--surface); }
.demo-out {
  background: var(--surface-2) radial-gradient(circle, rgba(14, 27, 42, .16) 1px, transparent 1.4px) 0 0 / 18px 18px;
}
@media (max-width: 900px) { .demo-in { border-right: 0; border-bottom: 1px solid var(--ink); } .demo { box-shadow: 5px 5px 0 var(--sun); } }

/* Labels: mono caps with an orange square, like the marks on an instrument */
.demo-label {
  display: flex; align-items: center; gap: .55rem; font: 500 .72rem/1.2 var(--mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink); margin: 0 0 .6rem;
}
.demo-label::before { content: ''; width: 7px; height: 7px; flex: none; background: var(--sun); }
.demo .field > label, .demo .field-label { font: 500 .72rem/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }

/* Selected chips go orange inside the instruments */
.demo .chip { background: var(--surface); }
.demo .chip[aria-pressed="true"], .demo .chip.is-on, .demo .qb-trades .chip[aria-pressed="true"], [data-demo="schedule"] .chip[aria-pressed="true"] {
  background: var(--sun); color: var(--ink); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink);
}
.demo .btn-sun, .demo .btn:not(.btn-ghost):not(.btn-ink) { border-radius: 4px; }

/* States */
.demo-empty { border: 1px dashed var(--ink); border-radius: 5px; background: var(--surface); }
.demo-empty::before { opacity: .55; }
.demo-empty b { font: 650 1.3rem/1.2 var(--display); letter-spacing: -.02em; }
.demo-error {
  border: 1px solid #8f2d14; border-left: 5px solid #c2410c; border-radius: 0 4px 4px 0; background: #fdf1ec; color: #7a2410;
  font: 500 .9rem/1.4 var(--mono); letter-spacing: .01em;
}
.demo-badge { border-radius: 3px; border: 1px solid var(--ink); background: var(--sun); color: var(--ink); font: 500 .7rem/1 var(--mono); letter-spacing: .06em; }
.demo-badge.offline { background: transparent; color: var(--ink); border-style: dashed; }
.is-loading::after { border-radius: 0; border: 3px solid var(--rule); border-top-color: var(--sun); }

/* Output furniture */
.demo-code, .rc-sms { background: var(--ink); color: #f1ece3; border-radius: 4px; border-left: 4px solid var(--sun); font-size: .82rem; }
.demo-table th { font: 500 .68rem/1.2 var(--mono); letter-spacing: .08em; color: var(--ink); border-bottom: 2px solid var(--ink); }
.demo-table td { border-bottom-color: var(--line); }
.demo-table tbody tr:nth-child(even) td { background: rgba(14, 27, 42, .035); }
.demo-table tfoot tr:last-child td { border-top-color: var(--ink); }
.demo-total { border-radius: 4px; background: var(--ink); color: var(--paper); }
.demo-total b { color: var(--amber); }
.demo-sheet { border: 1px solid var(--ink); border-radius: 5px; box-shadow: 5px 5px 0 var(--ink); }
.demo-stamp { border-radius: 3px; border-width: 1.5px; font: 500 .7rem/1 var(--mono); letter-spacing: .1em; }
.demo-meta { font: 500 .72rem/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: #4f5966; border-top-color: var(--ink); }
.demo-disclaimer { max-width: 80ch; margin-top: 1.4rem; padding-left: 14px; border-left: 2px solid var(--sun); font-size: .88rem; color: #4f5966; }

/* ── Quote ── */
.qb-doc { border: 1px solid var(--ink); border-radius: 5px; box-shadow: 5px 5px 0 var(--ink); }
.qb-head { border-bottom-color: var(--ink); }
.qb-biz { letter-spacing: -.02em; }
.qb-meta b { font-family: var(--mono); font-weight: 500; }
.qb-stop { border-radius: 0 4px 4px 0; border-left-width: 5px; }
.qb-check { border-radius: 0 4px 4px 0; border-left-width: 5px; }

/* ── Receptionist: a handset with ink glass, orange sent bubbles ── */
.rc-phone { border-radius: 10px; background: var(--ink); box-shadow: 6px 6px 0 var(--sun); padding: 8px; }
.rc-screen { border-radius: 4px; background: var(--paper); }
.rc-head { background: var(--ink-2); border-bottom: 2px solid var(--sun); }
.rc-avatar { border-radius: 3px; background: var(--sun); color: var(--ink); }
.rc-head .rc-new { border-radius: 3px; background: transparent; border: 1px solid rgba(251, 248, 243, .6); font: 500 .68rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.rc-head .rc-new:hover { background: rgba(251, 248, 243, .14); }
.rc-msg { border-radius: 4px; }
.rc-bot { background: var(--white); border: 1px solid var(--line-2); box-shadow: none; }
.rc-user { background: var(--sun); color: var(--ink); border: 1px solid var(--ink); font-weight: 500; }
.rc-typing span { border-radius: 0; background: var(--ink); }
.rc-sugg-row, .rc-form { background: var(--paper); }
.rc-form input { border-radius: 4px; border: 1px solid var(--ink); }
.rc-form input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.rc-box { border: 1px solid var(--ink); border-radius: 5px; }
.rc-f dt { font: 500 .66rem/1 var(--mono); letter-spacing: .08em; color: #4f5966; }
.rc-note-small { font: 500 .7rem/1.5 var(--mono); letter-spacing: .03em; text-transform: uppercase; color: #4f5966; }

/* ── Schedule, invoice, G-code: crisp corners and mono furniture on the shared pieces ── */
.demo-out :is(table, .sc-card, .iv-card, .gc-card) { border-radius: 4px; }
[data-demo="gcode"] .demo-code, [data-demo="gcode"] pre { border-radius: 4px; }

/* ── Page sections below the demo ── */
/* the worked example becomes an orange card on its ink section */
.page-demo .callout {
  --bg: var(--sun); --fg: var(--ink); --fg-2: var(--ink); --mut: #2b2118; --rule: rgba(14, 27, 42, .35);
  background: var(--sun); color: var(--ink); border: 2px solid var(--ink); border-radius: 5px; box-shadow: 8px 8px 0 var(--paper);
}
.page-demo .callout a { color: var(--ink); font-weight: 650; text-decoration-color: var(--ink); }
.page-demo .callout::after { background: var(--ink); }
.page-demo .tone-paper .callout { box-shadow: 8px 8px 0 var(--ink); }
.page-demo .callout :is(h3, h4) { font-size: 1.35rem; letter-spacing: -.03em; }
/* a short right-hand column stays in view while the long text on the left scrolls past */
@media (min-width: 1000px) {
  .page-demo .split.top > :last-child:not(.reveal-static) { position: sticky; top: 104px; align-self: start; }
}

/* ── /use-cases/ ── */
.st-section .section-head h2 { font-size: clamp(2.2rem, 5.6vw, 4.6rem); }
.cards-demo .card, .cards-demo .card-cta { border-radius: 5px; }
.qb-in, .demo input, .demo select, .demo textarea { border-radius: 3px; }

/* ── Review polish ── */
.demo-bar .pill { white-space: nowrap; flex-shrink: 0; }
.demo input:focus-visible, .demo select:focus-visible, .demo textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[data-demo="invoice"] .demo-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
[data-demo="invoice"] #iv-text { font-size: .7rem; }
@media (max-width: 900px) { [data-demo="invoice"] .demo-body { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .demo-bar { flex-direction: column; align-items: flex-start; gap: .45rem; }
  .demo-bar-title { flex-wrap: nowrap; align-items: center; gap: .6rem; letter-spacing: .03em; }
  .demo-bar-note { letter-spacing: .03em; width: 100%; }
}
