/* pulseq — editorial dark design system
   Shared tokens, typography, motion. Per-view CSS is inline in each HTML file. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,500;1,9..144,600;1,9..144,700&family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=JetBrains+Mono:wght@400;500;600&family=Rubik:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500&family=Roboto:ital,wght@0,400;0,500;0,700;0,900;1,400;1,700&display=swap');

:root {
  /* palette */
  --bg: #0A0D12;
  --surface: #121720;
  --surface-2: #1A2030;
  --surface-3: #222B3A;
  --border: #2A3240;
  --border-subtle: #1F2633;
  --text: #F5F1EA;
  --text-muted: #8892A6;
  --text-dim: #5A6478;
  --accent: #FFB547;
  --accent-warm: #F48E3A;
  --accent-dim: rgba(255, 181, 71, 0.12);
  --accent-ring: rgba(255, 181, 71, 0.35);
  --danger: #E06C75;
  --success: #7FB069;

  /* type */
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-bar: cubic-bezier(0.16, 1, 0.3, 1);

  /* geometry */
  --radius: 10px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* elevation */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.25), 0 8px 24px rgba(0,0,0,0.35);
  --shadow-accent: 0 0 0 1px rgba(255, 181, 71, 0.25), 0 12px 40px rgba(255, 181, 71, 0.18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

body {
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(255, 181, 71, 0.045), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 90%, rgba(244, 142, 58, 0.035), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* typography primitives */
.display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; line-height: 1.05; }
.display-italic { font-family: var(--font-display); font-style: italic; font-weight: 400; letter-spacing: -0.005em; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted);
}
.mono { font-family: var(--font-mono); }
.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
p { color: var(--text); }
em { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--accent); font-size: 1.02em; }

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

/* pill buttons (shared across views) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; min-height: 48px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-pill);
  font-family: var(--font-body); font-weight: 500; font-size: 15px;
  letter-spacing: 0.01em;
  transition: background 220ms var(--ease-out), border-color 220ms var(--ease-out), color 220ms var(--ease-out), transform 120ms var(--ease-out);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent); color: #0A0D12; border-color: var(--accent);
  font-weight: 600;
}
.btn.primary:hover { background: var(--accent-warm); border-color: var(--accent-warm); color: #0A0D12; }
.btn.ghost { border-color: transparent; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* surfaces */
.surface {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

/* live indicator (used on display & landing) */
.live-indicator {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text);
}
.live-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  animation: live-pulse 2.2s var(--ease-in-out) infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-ring); }
  70%  { box-shadow: 0 0 0 16px rgba(255, 181, 71, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 181, 71, 0); }
}

/* motion primitives */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes grow-x  { from { transform: scaleX(0) } to { transform: scaleX(1) } }
@keyframes pop-in  {
  0%   { opacity: 0; transform: scale(0.6); }
  60%  { opacity: 1; transform: scale(1.08); }
  100% { transform: scale(1); }
}
.fade-up { animation: fade-up 700ms var(--ease-out) both; }
.fade-in { animation: fade-in 500ms var(--ease-out) both; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* reconnecting toast (shared) */
.reconnect-toast {
  position: fixed; top: 20px; right: 20px; z-index: 10000;
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  display: none; align-items: center; gap: 10px;
  animation: fade-up 260ms var(--ease-out);
}
.reconnect-toast.show { display: inline-flex; }
.reconnect-toast .spin {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid var(--border); border-top-color: var(--accent);
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* utility */
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-sm { gap: 8px; } .gap { gap: 16px; } .gap-lg { gap: 28px; }
.grow { flex: 1; }
.center { display: flex; align-items: center; justify-content: center; }
.no-select { user-select: none; -webkit-user-select: none; }
