/* The plugin's palette, so the page and the editor read as one thing. */
:root {
  --bg: #0b1420;
  --panel: #101d2e;
  --grid: #1d3048;
  --accent: #4cc9f0;
  --accent-dim: rgba(76, 201, 240, 0.33);
  --text: #e8eef5;
  --dim: #93a8bd;
  --sw-support-accent: var(--accent);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 0 16px 32px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-weight: 700; letter-spacing: -0.01em; }

.top {
  max-width: 760px; margin: 0 auto; padding: 28px 0 18px;
  display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: flex-end; justify-content: space-between;
}
.top h1 { margin: 0 0 6px; font-size: 26px; }
.top .tag { font-size: 13px; font-weight: 500; color: var(--dim); margin-left: 8px; letter-spacing: 0.04em; text-transform: uppercase; }
.top .lede { margin: 0; color: var(--dim); max-width: 60ch; }
.top .lede strong { color: var(--text); font-weight: 600; }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }

main { max-width: 760px; margin: 0 auto; }

/* ------------------------------------------------------------- the plugin */
.plugin {
  background: var(--bg); border: 1px solid var(--grid); border-radius: 10px;
  padding: 0 14px 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.titlebar { display: flex; justify-content: space-between; align-items: center; height: 40px; }
.titlebar .name { font-weight: 700; font-size: 17px; }
.titlebar .sub { color: var(--dim); font-size: 12px; }
.curve { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--panel); }
.knobrow { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 18px 0 0; flex-wrap: wrap; }
.knob { width: 220px; height: 220px; touch-action: none; cursor: ns-resize; outline: none; border-radius: 50%; }
.knob:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.readout { text-align: center; min-width: 150px; }
.readout output { display: block; font: 500 26px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.readout .caption { color: var(--dim); font-size: 11px; letter-spacing: 0.08em; margin-top: 4px; }
.knobwrap { position: relative; padding-bottom: 18px; }
.knobwrap .end { position: absolute; bottom: 0; color: var(--dim); font-size: 12px; }
.knobwrap .end.open { left: 14px; }
.knobwrap .end.plugged { right: 6px; }

button {
  font: inherit; font-size: 14px; color: var(--text); background: var(--panel);
  border: 1px solid var(--grid); border-radius: 8px; padding: 9px 14px; cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
button.hold { margin-top: 14px; font-size: 13px; }
button.hold.active { background: var(--accent-dim); border-color: var(--accent); }

/* ------------------------------------------------------------- the sources */
.sources { padding: 22px 0 6px; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.meter { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; margin: 16px 0 10px; max-width: 420px; }
.meter .label { color: var(--dim); font-size: 11px; letter-spacing: 0.06em; }
.meter .bar { height: 8px; background: var(--panel); border-radius: 4px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 60ms linear; }
.meter .bar i.hot { background: #ffb454; }
.status { color: var(--dim); margin: 0; font-size: 14px; min-height: 1.5em; }
body.dragging .plugin { outline: 2px dashed var(--accent); outline-offset: 4px; }

/* ---------------------------------------------------------------- the notes */
.notes { padding-top: 18px; color: var(--dim); }
.notes h2 { color: var(--text); font-size: 17px; margin: 0 0 8px; }
.notes p, .notes li { margin: 0 0 10px; }
.notes ul { padding-left: 20px; margin: 0 0 12px; }
.notes strong { color: var(--text); }
.notes em { color: var(--text); font-style: normal; }
.notes .small { font-size: 13px; }

@media (max-width: 480px) {
  .knob { width: 180px; height: 180px; }
  .top h1 { font-size: 22px; }
}
