/* ==========================================================================
   FX-Utility Design System (Self-Contained, Zero External CDN Dependencies)
   Typography: ABC Oracle (from Dia Browser) & JetBrains Mono
   Aesthetics: Dia Browser (diabrowser.com) & BG2FX Engineering
   Strict LTR, WCAG 4.5:1 Contrast, Apple Silicon Architecture Specification
   ========================================================================== */

@font-face {
  font-family: 'ABC Oracle';
  src: url('../fonts/ABCOracle-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ABC Oracle';
  src: url('../fonts/ABCOracle-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ABC Oracle';
  src: url('../fonts/ABCOracle-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'ABC Oracle', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Tactical Slate & Olive (Dark Theme Default) */
  --bg-primary: #0a0d0e;
  --bg-secondary: #111618;
  --bg-tertiary: #171d20;
  --bg-elevated: #1e262a;
  --bg-card: rgba(19, 25, 28, 0.85);
  --bg-card-hover: rgba(26, 34, 38, 0.95);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.18);
  --border-focus: rgba(104, 134, 100, 0.6);

  /* BG2FX Tactical Olive Palette */
  --olive-50: #f4f6f3;
  --olive-100: #e4ebe2;
  --olive-200: #cad7c7;
  --olive-300: #a5bda0;
  --olive-400: #7b9f74;
  --olive-500: #5b8054;
  --olive-600: #466540;
  --olive-700: #385034;
  --olive-800: #2f412c;
  --olive-900: #273625;

  /* Instrument Readout Colors */
  --oled-cyan: #00f0ff;
  --oled-amber: #ffb800;
  --oled-green: #22c55e;
  --oled-red: #ef4444;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.7);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --bg-elevated: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.96);
  --bg-card-hover: #ffffff;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --border-subtle: rgba(0, 0, 0, 0.12);
  --border-light: rgba(0, 0, 0, 0.2);
  --border-focus: rgba(70, 101, 64, 0.7);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* Base resets & Strict LTR */
html, body {
  direction: ltr !important;
  box-sizing: border-box;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(91, 128, 84, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 70%, rgba(91, 128, 84, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
}

.font-mono {
  font-family: var(--font-mono) !important;
}

/* Dia-style Floating Glass Pill Navigation */
.dia-glass-nav {
  direction: ltr !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--border-subtle);
  border-radius: 9999px;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.dia-glass-nav:hover {
  border-color: var(--border-focus);
}

/* Mobile Dropdown Menu */
.mobile-nav-drawer {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-light);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-lg);
  padding: 1rem;
}

/* Dia Pill Buttons */
.dia-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.15rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}

.dia-pill-primary {
  background: linear-gradient(135deg, var(--olive-600) 0%, var(--olive-800) 100%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 10px rgba(70, 101, 64, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dia-pill-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--olive-500) 0%, var(--olive-700) 100%);
  box-shadow: 0 4px 18px rgba(70, 101, 64, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.dia-pill-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary) !important;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.dia-pill-secondary:hover {
  transform: translateY(-1px);
  background: var(--bg-elevated);
  border-color: var(--border-focus);
}

/* Bento Grid Cards */
.dia-bento-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 1.5rem;
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dia-bento-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg), 0 0 24px rgba(91, 128, 84, 0.15);
}

/* macOS Window Mockup */
.macos-window {
  direction: ltr !important;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-lg), 0 25px 60px -15px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.macos-titlebar {
  direction: ltr !important;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.macos-traffic-lights {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.macos-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  display: inline-block;
}

.macos-dot.red { background: #ff5f56; border: 1px solid #e0443e; }
.macos-dot.yellow { background: #ffbd2e; border: 1px solid #dea123; }
.macos-dot.green { background: #27c93f; border: 1px solid #1aab29; }

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.oss-glow-badge {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.status-badge.live {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.35);
}

[data-theme="light"] .status-badge.live {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.35);
}

.status-badge.olive {
  background: rgba(91, 128, 84, 0.2);
  color: #7b9f74;
  border-color: rgba(91, 128, 84, 0.4);
}

[data-theme="light"] .status-badge.olive {
  background: rgba(91, 128, 84, 0.12);
  color: #2f412c;
  border-color: rgba(91, 128, 84, 0.3);
}

.status-badge.amber {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="light"] .status-badge.amber {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.35);
}

.status-badge.cyan {
  background: rgba(0, 240, 255, 0.15);
  color: #0284c7;
  border-color: rgba(0, 240, 255, 0.35);
}

[data-theme="dark"] .status-badge.cyan {
  color: #38bdf8;
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse-dot 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Interactive Tabs */
.tab-btn {
  padding: 0.45rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.tab-btn.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

/* Audio Waterfall Canvas */
.waterfall-container {
  position: relative;
  background: #040608;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid rgba(0, 240, 255, 0.25);
}

canvas.waterfall-canvas {
  width: 100%;
  height: 160px;
  display: block;
  cursor: crosshair;
}

.waterfall-tx-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--oled-red);
  box-shadow: 0 0 8px var(--oled-red);
  pointer-events: none;
  z-index: 10;
}

.smeter-bar {
  display: flex;
  gap: 3px;
  align-items: flex-end;
}

.smeter-dot {
  width: 5px;
  height: 12px;
  background: #2a343b;
  border-radius: 1px;
  transition: all 0.15s ease;
}

.smeter-dot.active-green {
  background: var(--oled-green);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

.smeter-dot.active-amber {
  background: var(--oled-amber);
  box-shadow: 0 0 6px rgba(255, 184, 0, 0.8);
}

.smeter-dot.active-red {
  background: var(--oled-red);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.8);
}

/* Table Styling (Plain table without inline-block destruction) */
.fx-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.825rem;
}

.fx-table th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.6rem 0.85rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
}

.fx-table td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: background 0.15s ease;
}

.fx-table tr:hover td {
  background: rgba(91, 128, 84, 0.1);
}

.fx-table tr.selected td {
  background: rgba(91, 128, 84, 0.22);
  border-color: rgba(91, 128, 84, 0.4);
}

/* Screenshot preview container */
.screenshot-preview-container {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  background: #000;
}

.screenshot-preview-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* Hardware Ledger Table */
.hardware-ledger-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
}

.hardware-ledger-table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-light);
}

.hardware-ledger-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.hardware-ledger-table tr:hover td {
  background: var(--bg-card-hover);
}

/* prefers-reduced-motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ==========================================================================
