/* Ventriloc Editorial Quant Design System */
/* Warm monochrome paper architecture + single Ember Orange punctuation */

:root {
  /* Core Ventriloc Palette — Light Editorial Default */
  --color-graphite: #202020;
  --color-canvas-white: #ffffff;
  --color-ash: #efefef;
  --color-fog: #f5f5f5;
  --color-ivory: #ebe6dd;
  --color-steel: #4d4d4d;
  --color-slate: #828282;
  --color-mist: #e8e8e8;
  --color-ember-orange: #ff682c;
  --color-brass: #816729;

  /* Semantic Trading Accents (WCAG 4.5:1+ readable on light surfaces) */
  --color-profit: #15803d;
  --color-profit-bg: #eef7f0;
  --color-loss: #b91c1c;
  --color-loss-bg: #fdf1f1;
  --color-warn: #9a5b13;
  --color-warn-bg: #f8f2e8;

  /* Mapped Surface Tokens */
  --bg-canvas: #ffffff;
  --bg-surface: #efefef;
  --bg-surface-nested: #f5f5f5;
  --bg-featured: #ebe6dd;
  --bg-glass: rgba(255, 255, 255, 0.94);
  --border-hairline: #e8e8e8;
  --border-strong: #d4d4d0;
  --text-primary: #202020;
  --text-secondary: #4d4d4d;
  --text-muted: #828282;
  --brand-accent: #ff682c;

  /* Three-Radius System */
  --radius-buttons: 0px;
  --radius-asymmetric: 6px 0px 0px 6px;
  --radius-card-soft: 8px;
  --radius-tags: 20px;
  --radius-widget: 20px;
  --radius-nav-pill: 200px;

  /* Font Stacks */
  --font-display: 'Space Grotesk', 'Inter Tight', ui-sans-serif, system-ui, sans-serif;
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

html.dark {
  /* Opt-in Warm Charcoal Dark Variant */
  --bg-canvas: #141413;
  --bg-surface: #1d1d1b;
  --bg-surface-nested: #252522;
  --bg-featured: #27241f;
  --bg-glass: rgba(20, 20, 19, 0.94);
  --border-hairline: #2e2e2a;
  --border-strong: #3f3f3a;
  --text-primary: #f2f1ed;
  --text-secondary: #b8b6af;
  --text-muted: #85837c;
  --brand-accent: #ff682c;

  --color-profit: #4ade80;
  --color-profit-bg: rgba(74, 222, 128, 0.1);
  --color-loss: #f87171;
  --color-loss-bg: rgba(248, 113, 113, 0.1);
  --color-warn: #e5b869;
  --color-warn-bg: rgba(229, 184, 105, 0.1);
}

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

html, body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Signature Display Typography: weight 400 only, -0.02em tracking */
.font-display,
h1, h2, h3, .editorial-heading {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.font-mono-num,
.tabular-nums {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Ventriloc Architectural Surfaces (Zero box-shadows, tonal contrast only) */
.editorial-header {
  background-color: var(--bg-glass);
  border-bottom: 1px solid var(--border-hairline);
}

.editorial-pill-nav {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-nav-pill);
}

.editorial-card-ash {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card-soft);
}

.editorial-card-fog {
  background-color: var(--bg-surface-nested);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card-soft);
}

.editorial-card-asymmetric {
  background-color: var(--bg-featured);
  border: 1px solid var(--border-hairline);
  border-radius: 6px 0px 0px 0px;
}

.editorial-card-ivory {
  background-color: var(--bg-featured);
  border: 1px solid var(--border-hairline);
  border-radius: 6px 0px 0px 6px;
}

.editorial-widget-card {
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-widget);
}

html.dark .editorial-widget-card {
  background-color: var(--bg-surface);
}

/* Compatibility aliases mapped cleanly to editorial surfaces */
.notion-card,
.nexa-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card-soft);
  box-shadow: none;
}

.nexa-pill {
  background-color: var(--bg-surface-nested);
  border: 1px solid var(--border-hairline);
  border-radius: 0px;
  color: var(--text-primary);
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-left: 2px solid var(--stat-accent, var(--color-graphite));
  border-radius: 6px 0px 0px 6px;
}

/* Buttons: Sharp 0px Corners Only — Ember Orange NEVER used as primary CTA fill */
.btn-editorial-primary {
  background-color: var(--color-graphite);
  color: #ffffff;
  border: 1px solid var(--color-graphite);
  border-radius: 0px;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.btn-editorial-primary:hover {
  background-color: #363636;
  border-color: #363636;
}

html.dark .btn-editorial-primary {
  background-color: #f2f1ed;
  color: #141413;
  border-color: #f2f1ed;
}

html.dark .btn-editorial-primary:hover {
  background-color: #dedcd5;
}

.btn-editorial-ghost {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 0px;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.btn-editorial-ghost:hover {
  background-color: var(--bg-surface-nested);
  border-color: var(--text-primary);
}

.btn-editorial-danger {
  background-color: transparent;
  color: var(--color-loss);
  border: 1px solid var(--color-loss);
  border-radius: 0px;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: background-color 150ms ease, color 150ms ease;
}

.btn-editorial-danger:hover {
  background-color: var(--color-loss);
  color: #ffffff;
}

/* Terminal Control / Auto-Pilot Toggle */
.terminal-control-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 0px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn-pilot-active {
  background-color: var(--color-profit);
  color: #ffffff;
  border: 1px solid var(--color-profit);
}

html.dark .btn-pilot-active {
  color: #0b1f10;
}

.btn-pilot-standby {
  background-color: var(--bg-surface-nested);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

/* Editorial Link Punctuation — Ember Orange underline strictly for links/emphasis */
.editorial-link {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--color-ember-orange);
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
  transition: color 150ms ease;
}

.editorial-link:hover {
  color: var(--color-ember-orange);
}

.editorial-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-tags);
  border: 1px solid var(--border-hairline);
  background-color: var(--bg-surface-nested);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Editorial Modal Panels */
.modal-panel {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-top: 2px solid var(--color-graphite);
  border-radius: 6px 0px 0px 0px;
  box-shadow: none;
}

html.dark .modal-panel {
  background-color: var(--bg-surface);
  border-top-color: #f2f1ed;
}

/* Custom Scrollbar (quiet neutral) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 0px;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Subtle Semantic Helpers */
.text-profit { color: var(--color-profit); }
.text-loss { color: var(--color-loss); }
.text-ember { color: var(--color-ember-orange); }
.text-brass { color: var(--color-brass); }
.bg-profit-subtle { background-color: var(--color-profit-bg); }
.bg-loss-subtle { background-color: var(--color-loss-bg); }

/* Focus Visible Ring (Accessibility Gate) */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-ember-orange);
  outline-offset: 2px;
}

/* Minimal Entrance Animation */
@keyframes fadeUpEditorial {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fadeUpEditorial 180ms ease-out forwards;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.animate-shake {
  animation: shake 260ms ease-in-out;
}

@keyframes pulseSubtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.animate-pulse-subtle {
  animation: pulseSubtle 2.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
