/* ==========================================================================
   Demo page styles. Nothing here is part of BlockQuotes — the library's own
   look lives in libs/blockquotes/blockquotes.css. Loaded after it, so the
   .amber overrides at the bottom win at equal specificity.
   ========================================================================== */

:root {
  --panel: #171c21;
  --panel-edge: #262f38;
  --face: #10151a;
  --ink: #dfe7ee;
  --ink-dim: #8496a5;
  --accent: #5fc3a6;
  --screw: #2f3a45;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: ui-serif, "Iowan Old Style", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 90% at 50% -10%, #1b232b 0%, #0c1014 60%),
    #0c1014;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  padding: clamp(1.5rem, 5vw, 4rem) 1.25rem 3rem;
}

main { max-width: 54rem; margin: 0 auto; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 6vw, 3.2rem);
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}

.lede { color: var(--ink-dim); max-width: 46ch; margin: 0 0 2.5rem; }

/* The control panel is styled as a rack unit: recessed face, engraved
   labels, screw heads at the corners. */
.rack {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--face));
  border: 1px solid var(--panel-edge);
  border-radius: 6px;
  padding: 1.6rem 1.5rem 1.4rem;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%), 0 20px 50px rgb(0 0 0 / 45%);
}

.rack::before, .rack::after,
.rack .screw { position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #55636f, var(--screw));
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 40%); }
.rack::before { content: ""; top: 9px; left: 9px; }
.rack::after  { content: ""; top: 9px; right: 9px; }
.rack .screw.bl { bottom: 9px; left: 9px; }
.rack .screw.br { bottom: 9px; right: 9px; }

.rack-legend {
  position: absolute;
  top: -0.62rem;
  left: 1.4rem;
  background: #0f1418;
  padding: 0 0.55rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1.1rem 1.4rem;
}

.control { display: grid; gap: 0.4rem; }

.control > span {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

select, input[type="range"], button {
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  background: #0b0f13;
  border: 1px solid var(--panel-edge);
  border-radius: 5px;
  padding: 0.4rem 0.55rem;
}

input[type="range"] { padding: 0; accent-color: var(--accent); }

button { cursor: pointer; }
button:hover, select:hover { border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem;
  padding-top: 1.2rem; border-top: 1px dashed var(--panel-edge); }

.actions button.primary { background: var(--accent); border-color: var(--accent);
  color: #06100d; font-weight: 600; }

.readout {
  margin-top: 1.1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-dim);
  border-left: 2px solid var(--accent);
  padding-left: 0.8rem;
}

.readout b { color: var(--ink); font-weight: 600; }

section { margin-top: 3rem; }

h2 {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--panel-edge);
  padding-bottom: 0.5rem;
  margin: 0 0 1.2rem;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 0.18em;
}

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

.aside {
  margin: 1.1rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-dim);
}

.aside code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--ink);
}

.hint {
  font-size: 0.9em;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: none;
}

.snippet {
  position: relative;
}

.snippet__copy {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  color: var(--ink-dim);
  background: transparent;
}

.snippet__copy:hover {
  color: var(--ink);
}

pre {
  background: #0b0f13;
  border: 1px solid var(--panel-edge);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  padding-right: 6rem;
  margin: 0;
  min-height: 7.5rem;
  white-space: pre-wrap;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.65;
  color: #cfe3dc;
}

.sources { display: grid; gap: 0.5rem; font-family: var(--mono); font-size: 0.75rem; }
.sources div { display: flex; justify-content: space-between; gap: 1rem;
  border-bottom: 1px dotted var(--panel-edge); padding-bottom: 0.4rem; }
.sources span:last-child { color: var(--accent); }

.filler { color: var(--ink-dim); font-family: var(--serif); font-size: 1.05rem; }

/* An alternative palette, applied by the theme picker — proof that the
   library is restyled entirely through custom properties. */
body.amber .bq {
  --bq-accent: #ffb000;
  --bq-bg: #14100a;
  --bq-bg-raised: #1e1710;
  --bq-fg: #ffd899;
  --bq-muted: #b58a4d;
  --bq-border: #3a2c17;
  --bq-font-quote: var(--mono);
}

/* Map this page's palette onto the shared Settings component (js/settings.js).
   The rack aesthetic is darker than the component's defaults, so the panel
   picks up the same face and edge colours as the control panel above it. */
:root {
  --settings-bg: var(--panel);
  --settings-fg: var(--ink);
  --settings-muted: var(--ink-dim);
  --settings-border: var(--panel-edge);
  --settings-accent: var(--accent);
  --settings-mono: var(--mono);
}
