/* demo/demo.css — the Sovereign Creator demonstration build.
 *
 * This is the PRODUCT's own surface, so it wears the product's palette (the dark
 * violet scheme from the application's globals.css) rather than the parchment
 * identity of the landing page. That contrast is deliberate: the page you read is
 * a printed programme, and the thing it demonstrates is a dark app shell.
 *
 * NO INLINE STYLES: the site's CSP is `style-src 'self'` with no 'unsafe-inline',
 * so a style="..." attribute or a <style> block is dropped by the browser. Poster
 * variation is expressed with CSS custom properties set by nth-child rules below,
 * never by an attribute on the element.
 */

:root {
  --bg: #0b0d12;
  --bg-elevated: #12151d;
  --bg-input: #171b25;
  --border: #242a38;
  --border-strong: #333c4f;
  --text: #e8ebf2;
  --text-dim: #a7b0c4;
  --text-faint: #838da3;
  --accent: #8f74ff;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --success: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 10px;
  --radius-lg: 14px;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.22;
  margin: 0 0 0.5rem;
  font-weight: 650;
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.15rem;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0 0 0.75rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 0.25em;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.1rem 2.5rem;
}

/* ---------- the permanent notice ---------- */

.notice {
  margin: 0;
  padding: 0.7rem 1.1rem;
  background: #2a2410;
  border-bottom: 1px solid var(--warn);
  color: #f6e7bf;
  font-size: 0.85rem;
  line-height: 1.5;
}

.notice strong {
  color: #ffe9b0;
}

/* ---------- app bar ---------- */

.app-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.app-bar__mark {
  display: block;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}

.app-bar__name {
  font-weight: 700;
  font-size: 1.05rem;
}

.app-bar__tag {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.lede {
  color: var(--text-dim);
  max-width: 78ch;
}

/* ---------- panels ---------- */

.panel {
  margin: 1.4rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}

.panel h2 {
  margin-top: 0;
}

.hint {
  color: var(--text-faint);
  font-size: 0.86rem;
  max-width: 80ch;
}

/* ---------- controls ---------- */

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  margin: 0.4rem 0 0;
}

@media (min-width: 820px) {
  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.control {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  padding: 0.75rem 0.85rem 0.85rem;
  margin: 0;
}

.control__label {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 0.3rem;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
}

.seg-btn input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.seg-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.seg-btn:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.seg-btn:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: var(--text-dim);
  font-size: 0.88rem;
  cursor: pointer;
}

.switch input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.stepper__btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.stepper__btn:hover {
  border-color: var(--accent);
}

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

.stepper__val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  min-width: 5ch;
}

/* ---------- stats ---------- */

.stats {
  font-size: 0.92rem;
  color: var(--text-dim);
  border-left: 3px solid var(--accent);
  padding-left: 0.7rem;
}

/* ---------- catalogue grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.2rem;
}

.film {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
}

.film--locked {
  border-color: var(--border-strong);
}

.film--withheld {
  border-style: dashed;
}

.film__art {
  --h1: 268;
  --h2: 320;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  background-image: linear-gradient(160deg, hsl(var(--h1) 42% 34%) 0%, hsl(var(--h2) 46% 16%) 68%, #0b0d12 100%);
  position: relative;
}

.film:nth-child(2n) .film__art {
  --h1: 12;
  --h2: 340;
}

.film:nth-child(3n) .film__art {
  --h1: 172;
  --h2: 250;
}

.film:nth-child(4n) .film__art {
  --h1: 42;
  --h2: 300;
}

.film:nth-child(5n) .film__art {
  --h1: 210;
  --h2: 280;
}

.film__art::after {
  content: "";
  position: absolute;
  inset: 12% 14%;
  border: 1px solid rgba(232, 235, 242, 0.22);
  border-radius: 4px;
}

.film__lock {
  position: absolute;
  left: 0.4rem;
  top: 0.4rem;
  z-index: 2;
  background: rgba(11, 13, 18, 0.88);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text);
}

.film__body {
  padding: 0.6rem 0.65rem 0.7rem;
}

.film__title {
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.25;
  margin: 0 0 0.15rem;
}

.film__meta {
  color: var(--text-faint);
  font-size: 0.78rem;
  margin: 0 0 0.4rem;
}

.film__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 0.4rem;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  color: var(--text-dim);
}

.tag--ok {
  border-color: rgba(74, 222, 128, 0.5);
  color: var(--success);
}

.tag--bad {
  border-color: rgba(248, 113, 113, 0.5);
  color: var(--danger);
}

.tag--warn {
  border-color: rgba(251, 191, 36, 0.5);
  color: var(--warn);
}

.film__reason {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--text-dim);
}

.caption {
  color: var(--text-faint);
  font-size: 0.84rem;
  max-width: 80ch;
}

/* ---------- withheld list ---------- */

.withheld {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.withheld__item {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-input);
  padding: 0.65rem 0.75rem;
}

.withheld__title {
  margin: 0 0 0.2rem;
  font-weight: 650;
  font-size: 0.92rem;
}

.withheld__reason {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.84rem;
}

/* ---------- gate explainers ---------- */

.gates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
}

.gate {
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  padding: 0.85rem 0.9rem;
}

.gate__name {
  margin: 0 0 0.3rem;
}

.gate__state {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.gate p:last-child {
  margin-bottom: 0;
  color: var(--text-dim);
  font-size: 0.86rem;
}

/* ---------- footer ---------- */

.foot {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.2rem 1.1rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.85rem;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
