/* ============================================================
   The Raga Journal — design tokens
   Paper-white editorial look. Signature motif: the "drone rule",
   a hairline divider that pulses like a sustained tanpura drone
   while content is committing to GitHub.
   ============================================================ */

:root {
  --paper: #FAF8F4;
  --paper-dim: #F3EFE7;
  --ink: #1C1B19;
  --ink-soft: #3D3A35;
  --ink-faint: #6B6660;
  --hairline: #E3DDD2;

  --brass-50: #FBF3E6;
  --brass-100: #F3E2C2;
  --brass-200: #E6C68A;
  --brass-300: #D4A85A;
  --brass-500: #A8762E;
  --brass-600: #8C5F24;
  --brass-700: #6E4A1C;

  --sage: #5C7A5C;
  --sage-dim: #EAEFE9;
  --rust: #A8432E;
  --rust-dim: #F6E8E3;

  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(28, 27, 25, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: inherit; }

.mono { font-family: 'JetBrains Mono', 'SF Mono', monospace; }

.faint { color: var(--ink-faint); }
.soft { color: var(--ink-soft); }

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover:not(:disabled) { background: var(--ink-soft); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--hairline); }
.btn-ghost:hover:not(:disabled) { background: var(--paper-dim); }
.btn-danger { background: transparent; color: var(--rust); }
.btn-danger:hover:not(:disabled) { background: var(--rust-dim); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Inputs ---------- */
.input, select.input, textarea.input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, select.input:focus, textarea.input:focus {
  outline: none;
  border-color: var(--brass-300);
  box-shadow: 0 0 0 3px var(--brass-100);
}
.input::placeholder { color: var(--ink-faint); }
label.field-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

/* ---------- Cards / panels ---------- */
.panel {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: #fff;
}
.divide > * + * { border-top: 1px solid var(--hairline); }

/* ---------- Signature motif: the drone rule ---------- */
.drone-rule {
  height: 1px;
  background: var(--hairline);
  position: relative;
  overflow: hidden;
}
.drone-rule.is-active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--brass-500);
  animation: drone 1.2s ease-in-out infinite;
}
@keyframes drone {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise-in { animation: riseIn 0.35s ease-out; }

/* ---------- Status badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-draft, .badge-archived { background: var(--paper-dim); color: var(--ink-faint); }
.badge-review { background: var(--brass-50); color: var(--brass-700); }
.badge-scheduled, .badge-published { background: var(--sage-dim); color: var(--sage); }

/* ---------- Scrollbars ---------- */
.scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 4px; }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* ---------- Logo mark ---------- */
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--rust); }

/* ---------- Loading spinner ---------- */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.center-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 14px;
  padding: 48px 0;
}
