/**
 * Shared styling for the Resolume plugin demos.
 *
 * Dark, because that is what these effects are looked at in and because a
 * picture with real blacks in it needs somewhere dark to sit. The inspector on
 * the right is laid out the way a host's parameter panel is — name on the left,
 * control and value on the right, grouped under headings — but it deliberately
 * does not imitate Resolume's own chrome. It is a stand-in for the host's
 * inspector, and a page that looked like a screenshot of Arena would be
 * claiming to be something it is not.
 *
 * No colour variables from the website: these pages are their own thing and the
 * navy is used only for the frame. `--sw-support-accent` is read by the shared
 * support footer.
 */

:root {
  --bg: #0b0d12;
  --panel: #12151d;
  --panel-2: #171b25;
  --line: #262c3a;
  --text: #e6e9f0;
  --muted: #9aa3b8;
  --accent: #6fd3c7;
  --accent-dim: #2a4d4a;
  --warn: #f0b429;
  --error: #ff6b6b;
  --navy: #1b2a4a;
  --sw-support-accent: #6fd3c7;

  color-scheme: dark;
}

* { box-sizing: border-box; }

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

#demo {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

a { color: var(--accent); }
a:hover { color: #9ae7dd; }

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }

/* ---- header -------------------------------------------------------------- */

.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 22px;
  background: linear-gradient(180deg, #1d2334, #171c2a);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: 8px;
}

.banner__tag {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--warn);
  color: #241a00;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 2px;
}

.banner__text { margin: 0; color: #cfd6e6; font-size: 14px; }

.head__title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.head__title h1 { font-size: clamp(28px, 4vw, 40px); }

.head__id {
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 7px;
}

.head__tagline {
  margin: 8px 0 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 16px;
}

.head__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 14px 0 24px;
  font-size: 14px;
}

.head__link { text-decoration: none; border-bottom: 1px solid var(--accent-dim); }
.head__link:hover { border-bottom-color: currentColor; }

/* ---- layout -------------------------------------------------------------- */

.layout {
  display: grid;
  /* 348px is set by the widest plugin: Old Cathode declares 34 controls in four
     groups, and below this "Luma Bandwidth" and "Chroma Bandwidth" wrap. */
  grid-template-columns: minmax(0, 1fr) 348px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---- stage --------------------------------------------------------------- */

.stage { min-width: 0; }

.stage__canvas {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}

/* What sits under the effect's own alpha. */
.stage__canvas[data-backdrop='checker'] {
  background-color: #23262e;
  background-image:
    linear-gradient(45deg, #191c23 25%, transparent 25%),
    linear-gradient(-45deg, #191c23 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #191c23 75%),
    linear-gradient(-45deg, transparent 75%, #191c23 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.stage__canvas[data-backdrop='black'] { background: #000; }
.stage__canvas[data-backdrop='white'] { background: #fff; }

.stage__gl {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.stage__status {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.stage__status.is-error {
  border-color: #5a2530;
  background: #23151a;
  color: #ffb4b4;
}

/* ---- transport ----------------------------------------------------------- */

.transport {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 12px;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.btn:hover { border-color: #3a4256; background: #1d2230; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn--play { min-width: 74px; }

.transport__field { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.transport__label { color: var(--muted); }

.transport__select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 26px 6px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.transport__file { cursor: pointer; }
.transport__file .btn { display: inline-block; }

/* ---- inspector ----------------------------------------------------------- */

.inspector {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .inspector { position: static; max-height: none; }
}

.inspector__head {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.inspector__title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.inspector__note { margin: 8px 0 0; font-size: 12px; color: var(--muted); line-height: 1.45; }

.inspector__actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.inspector__presets {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
}

.inspector__body { overflow-y: auto; padding: 4px 0 10px; }

.pgroup { padding: 6px 0; }
.pgroup + .pgroup { border-top: 1px solid var(--line); }

.pgroup__name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  padding: 10px 14px 6px;
}

/* ---- one parameter ------------------------------------------------------- */

/* The third column is `auto` rather than a fixed width because a readout may be
   a word — Porthole's Projection names the lens it has landed on ("equidistant"),
   which is the whole point of that control. A fixed column clipped it. */
.prow {
  display: grid;
  grid-template-columns: 88px minmax(40px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
}

.prow--option,
.prow--boolean,
.prow--text,
.prow--colour { grid-template-columns: 88px minmax(0, 1fr); }

.prow__name {
  font-size: 12px;
  color: #c3cad9;
  overflow-wrap: anywhere;
  cursor: default;
}

.prow__value {
  font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  text-align: right;
  cursor: help;
  white-space: nowrap;
  min-width: 42px;
  max-width: 104px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prow__slider {
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  cursor: ew-resize;
}

.prow__slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: #2b3142;
}
.prow__slider::-moz-range-track { height: 4px; border-radius: 2px; background: #2b3142; }

.prow__slider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
}
.prow__slider::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: none;
}
.prow__slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.prow__select,
.prow__text {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 5px;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
}

.prow__toggle {
  justify-self: start;
  min-width: 56px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  border-radius: 5px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.prow__toggle.is-on {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--text);
}

.prow__swatch {
  justify-self: start;
  width: 46px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: none;
  cursor: pointer;
}

/* ---- the honest bit ------------------------------------------------------ */

.differences {
  margin-top: 28px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
}

.differences summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.differences ul { margin: 10px 0 0; padding-left: 20px; }
.differences li { margin-bottom: 8px; line-height: 1.5; }
.differences li:last-child { margin-bottom: 0; }
