/* ==================================================================
   Perception AI (PAI) — Design tokens
   Shared with PAI Chat (EGLE) and PAI Subtitles (OWLE). Dark only:
   PAI is the master-brand flagship, so no theme toggle.
================================================================== */
:root {
  /* Brand — PAI blue */
  --primary: #135bec;
  --primary-end: #6d9afa;
  --primary-hover: #2f6ff0;
  --primary-active: #0f4bd1;
  --primary-light: #60a5fa;
  --primary-muted-bg: #0a1f3d;
  --primary-subtle: rgba(19, 91, 236, 0.14);
  --primary-ring: rgba(19, 91, 236, 0.35);

  /* Backgrounds */
  --bg-deep: #000000;
  --bg-base: #18181b;
  --bg-surface: #1f1f22;
  --bg-elevated: #27272a;
  --bg-hover: #2a2a2e;
  --bg-interactive: #3f3f47;
  --bg-overlay: rgba(24, 24, 27, 0.80);
  --bg-scrim: rgba(0, 0, 0, 0.60);

  /* Borders */
  --border: #27272a;
  --border-strong: #3f3f47;
  --border-input: #4a4a51;
  --border-accent: rgba(19, 91, 236, 0.30);

  /* Text */
  --text-heading: #fafafa;
  --text-primary: #e5e5e5;
  --text-secondary: #d4d4d8;
  --text-tertiary: #a3a3a3;
  --text-quaternary: #71717a;
  --text-muted: #52525c;
  --text-on-primary: #ffffff;

  /* Status accents (used sparingly) */
  --success-fg: #4ade80;
  --queue-fg: #7dd3fc;
  --purple-fg: #c084fc;

  /* Brand palette (pai-brand.netlify.app) */
  --ink:   #05060c;
  --slate: #0a0c1c;
  --mist:  #eef1f8;
  --paper: #f4f1ec;

  /* Per-pillar identity — one master brand, a coherent family of products.
     Signal Blue (--primary) stays the master action color; each product line
     carries its own brand accent + ambient glow per the brand guidelines. */
  --chat-accent: #1fc0ab;     /* PAI Chat — teal       */
  --chat-glow:   rgba(31, 192, 171, 0.42);
  --subs-accent: #9b6cf5;     /* PAI Subtitles — violet */
  --subs-glow:   rgba(155, 108, 245, 0.42);
  --subs-glow-2: rgba(125, 211, 252, 0.26);
  --wallet-accent: #7d74ea;   /* PAI Wallet — periwinkle */
  --wallet-glow:   rgba(125, 116, 234, 0.44);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* Layout */
  --maxw: 1200px;
  --maxw-narrow: 880px;

  /* High-end motion easings */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============== RESET ============== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-deep);
  color: var(--text-secondary);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5 {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-heading);
  margin: 0;
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-feature-settings: 'ss01' on, 'ss02' on, 'cv11' on;
}
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; padding: 0; }
img, svg { display: block; max-width: 100%; }
::selection { background: rgba(19, 91, 236, 0.30); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ============== BUTTONS (high-end, button-in-button pattern) ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 8px 0 22px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.012em;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.4s var(--ease-spring),
    border-color 0.4s var(--ease-spring),
    color 0.3s var(--ease-spring),
    transform 0.3s var(--ease-spring);
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 14px; height: 14px; }

/* Button-in-button trailing arrow island */
.btn .btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: transform 0.5s var(--ease-spring), background 0.3s var(--ease-spring);
}
.btn:hover .btn-arrow { transform: translate(2px, -1px); background: rgba(255, 255, 255, 0.30); }
.btn-ghost .btn-arrow { background: rgba(255, 255, 255, 0.06); }
.btn-ghost:hover .btn-arrow { background: rgba(255, 255, 255, 0.12); }

.btn-primary {
  background: var(--primary);
  color: var(--text-on-primary);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 12px 30px -18px var(--primary-ring);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-light { background: var(--text-heading); color: var(--bg-deep); padding-left: 22px; padding-right: 8px; }
.btn-light:hover { filter: brightness(0.92); }
.btn-light .btn-arrow { background: rgba(0, 0, 0, 0.10); }
.btn-light:hover .btn-arrow { background: rgba(0, 0, 0, 0.18); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-heading);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.18); }

.btn-lg { height: 54px; padding: 0 8px 0 26px; font-size: 15px; }
.btn-lg .btn-arrow { width: 36px; height: 36px; }
.btn-lg svg { width: 15px; height: 15px; }
.btn-sm { height: 36px; padding: 0 6px 0 16px; font-size: 13px; }
.btn-sm .btn-arrow { width: 24px; height: 24px; }
.btn-block { width: 100%; }

/* Variant: button with no trailing arrow icon — restore symmetric padding */
.btn.btn-flat { padding: 0 22px; }
.btn-lg.btn-flat { padding: 0 26px; }
.btn-sm.btn-flat { padding: 0 14px; }

.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-ring); }

/* Brand-marked CTA — leading icon, no wordmark */
.btn-brand { padding-left: 12px !important; gap: 10px; }
.btn-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 380ms cubic-bezier(0.32, 0.72, 0, 1);
  flex-shrink: 0;
}
.btn-brand-mark svg {
  width: 16px;
  height: 16px;
  display: block;
}
.btn-brand:hover .btn-brand-mark {
  transform: scale(1.06);
}
