/* Rabiat Kit: shared colour, type and a few components for /tools and /playground.
   Rabiat Theme v2.0 tokens (the ones Audio Playground uses). Layouts are per tool;
   only the palette, fonts and small parts are shared here.
   Rules: red is the brand mark, not a state. Primary actions are bone.
   Selection is a bone outline. Explanations live behind an (i), not on the page. */
:root {
  --r-void: #0A0A0A;
  --r-obsidian: #141414;
  --r-shadow: #1E1E1E;
  --r-midnight: #2A2A2A;
  --r-graphite: #3A3A38;
  --r-bone: #F5F5F0;
  --r-pearl: #E8E8E3;
  --r-ash: #A0A09A;
  --r-slate: #5A5A55;
  --r-bloodline: #D62828;
  --r-bloodline-light: #F05454;
  --r-teal: #5EEAD4;

  --bg: var(--r-void);
  --surface: var(--r-obsidian);
  --surface-2: var(--r-shadow);
  --border: var(--r-midnight);
  --border-strong: var(--r-graphite);
  --text: var(--r-bone);
  --text-2: var(--r-pearl);
  --muted: var(--r-ash);
  --subtle: var(--r-slate);
  --brand: var(--r-bloodline);
  --teal: var(--r-teal);

  --f-display: 'Rajdhani', 'Barlow Condensed', system-ui, sans-serif;
  --f-body: 'Lora', Georgia, serif;
  --f-mono: 'DM Mono', ui-monospace, Menlo, monospace;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--text-2); }
main { max-width: 1180px; margin: 0 auto; padding: 0 28px 64px; }
@media (max-width: 600px) { main { padding: 0 16px 48px; } }

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; gap: 12px;
  max-width: 1180px; margin: 0 auto; padding: 22px 28px 18px;
}
@media (max-width: 600px) { .top { padding: 16px; } }
.brand { font-family: var(--f-display); text-transform: uppercase; line-height: .95; text-decoration: none; color: var(--text); }
.brand .b1 { display: block; color: var(--brand); font-weight: 700; font-size: 13px; letter-spacing: .2em; }
.brand .b2 { display: block; font-weight: 700; font-size: 28px; letter-spacing: .01em; }
.spacer { flex: 1; }
.site-link {
  font: 600 13px var(--f-display); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; padding: 8px 4px;
}
.site-link:hover { color: var(--text); }
.site-link { white-space: nowrap; }
.brand { min-width: 0; }
@media (max-width: 440px) {
  .top { gap: 8px; }
  .brand .b2 { font-size: 21px; }
  .site-link { font-size: 11px; letter-spacing: .05em; padding: 8px 0; }
}

/* ---------- Info (i) ---------- */
.info { position: relative; }
.info-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: transparent; color: var(--muted); cursor: pointer;
  font: italic 600 15px/1 Georgia, serif; display: grid; place-items: center;
}
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--text); border-color: var(--text-2); }
.info-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.pop {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50; width: min(340px, 86vw);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: 0 18px 50px rgba(0,0,0,.55);
  font-size: 14px; color: var(--text-2);
}
.pop h4 { margin: 0 0 6px; font: 700 13px var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--text); }
.pop p { margin: 0 0 10px; }
.pop p:last-child, .pop ul:last-child { margin-bottom: 0; }
.pop ul { margin: 0 0 10px; padding-left: 18px; }
.pop li { margin: 3px 0; }
.pop .fine { color: var(--muted); font-size: 12.5px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); border-radius: 8px; padding: 9px 16px;
  font: 600 14px/1.1 var(--f-display); letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  text-decoration: none; transition: background .12s, border-color .12s, color .12s, opacity .12s, transform .08s;
}
.btn:hover:not(:disabled) { background: var(--r-midnight); border-color: var(--subtle); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn.primary { background: var(--r-bone); border-color: var(--r-bone); color: var(--r-void); }
.btn.primary:hover:not(:disabled) { background: #fff; border-color: #fff; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.quiet:hover:not(:disabled) { color: var(--text); background: var(--surface-2); border-color: transparent; }
.btn.lg { padding: 13px 22px; font-size: 16px; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }
.btn.icon { padding: 9px 11px; }
.is-selected { outline: 2px solid var(--r-bone) !important; outline-offset: 2px; }

kbd {
  font: 12px var(--f-mono); color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px;
}

/* ---------- Inputs ---------- */
input[type=range] { accent-color: var(--r-bone); width: 100%; }
input[type=number], input[type=text] {
  padding: 7px 9px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--r-void); color: var(--text); font: 13px var(--f-mono);
}
input[type=number]:focus, input[type=text]:focus { outline: none; border-color: var(--r-bone); }

/* ---------- Status ---------- */
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); }
.status { color: var(--muted); font: 13px var(--f-mono); }
.status.error { color: var(--r-bloodline-light); }
.status.ok { color: var(--teal); }
.bar { height: 3px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--r-bone); transition: width .15s; }
.spinner {
  display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--r-bone);
  animation: rk-spin .8s linear infinite; vertical-align: -2px;
}
@keyframes rk-spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--r-bone); color: var(--r-void); border-radius: 8px; padding: 10px 16px;
  font: 600 14px var(--f-display); letter-spacing: .06em; text-transform: uppercase;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Full-bleed pages (playground) ----------
   The effect fills the window; the header floats over it and controls sit in
   one small dock at the bottom. */
.top.float { position: fixed; top: 0; left: 0; right: 0; z-index: 20; max-width: none; pointer-events: none; }
.top.float > * { pointer-events: auto; }
.top.float .brand, .top.float .site-link { text-shadow: 0 1px 12px rgba(0,0,0,.6); }
.dock {
  /* left/right 0 + auto margins centre it; left: 50% would only give it half the screen to lay out in */
  position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 20;
  display: flex; align-items: center; gap: 4px; padding: 5px; max-width: calc(100vw - 24px);
  border-radius: 12px; border: 1px solid var(--border-strong);
  background: rgba(20,20,20,.74); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.dock .btn { border-color: transparent; background: transparent; color: var(--muted); padding: 8px 12px; font-size: 13px; }
.dock .btn:hover:not(:disabled) { color: var(--text); background: var(--surface-2); border-color: transparent; }
.dock .btn[aria-pressed="true"] { color: var(--text); background: var(--r-midnight); }
.dock .btn.primary, .dock .btn.primary:hover:not(:disabled) { background: var(--r-bone); color: var(--r-void); }
.dock .sep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--border-strong); }
.dock .lbl { font: 600 11px var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 0 6px 0 8px; }
.dock input[type=range] { width: 150px; margin: 0 8px; }
@media (max-width: 520px) {
  .dock { flex-wrap: wrap; justify-content: center; row-gap: 2px; }
  .dock .sep { display: none; }
  .dock input[type=range] { width: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
