/* KI Heka — Multi-Resolution Semantic Zoom Reader Stylesheet */

@layer base {
  html, body {
    overflow-x: hidden;
    width: 100%;
    min-height: 100%;
    touch-action: manipulation;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.4);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 119, 6, 0.6);
}

/* Theme Definitions */
body.theme-light {
  background-color: #faf9f6;
  color: #1c1917;
}
body.theme-sepia {
  background-color: #f5efe4;
  color: #382c1e;
}
body.theme-dark {
  background-color: #0b0f19;
  color: #e2e8f0;
}

/* ATU Card Base & Transition Animations */
.atu-card {
  position: relative;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  border-radius: 0.75rem;
}

/* Smooth content cross-fade for zoom level shifts */
.zoom-fade-enter {
  opacity: 0;
  transform: translateY(3px);
}
.zoom-fade-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Focal Zoom Demarcation (Local Overrides) */
.atu-focal-override {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.65), 0 8px 24px -4px rgba(245, 158, 11, 0.15);
  border-left: 4px solid #d97706 !important;
  background: linear-gradient(to right, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.02) 40%, transparent) !important;
}
.dark .atu-focal-override {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.75), 0 8px 28px -4px rgba(245, 158, 11, 0.25);
  border-left: 4px solid #f59e0b !important;
  background: linear-gradient(to right, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.03) 40%, transparent) !important;
}

/* Semantic Invariant Anchor Tokens */
.anchor-token {
  font-family: inherit;
  font-weight: 600;
  color: #92400e;
  background-color: rgba(245, 158, 11, 0.12);
  border-bottom: 1.5px dotted #d97706;
  border-radius: 0.2rem;
  padding: 0.05rem 0.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline;
}
.dark .anchor-token {
  color: #fcd34d;
  background-color: rgba(245, 158, 11, 0.22);
  border-bottom-color: #f59e0b;
}
.anchor-token:hover {
  background-color: #d97706;
  color: #ffffff;
  border-bottom-color: transparent;
  box-shadow: 0 1px 4px rgba(217, 119, 6, 0.3);
}
.anchor-token.token-active-highlight {
  background-color: #d97706 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.7);
}

/* Citation Badges */
.cite-pill {
  font-family: 'JetBrains Mono', monospace;
  display: inline-flex;
  align-items: center;
  padding: 0 0.35rem;
  margin: 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 0.25rem;
  cursor: pointer;
  background-color: rgba(245, 158, 11, 0.18);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.35);
  transition: all 0.15s ease;
  vertical-align: baseline;
  user-select: none;
}
.dark .cite-pill {
  background-color: rgba(245, 158, 11, 0.25);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.45);
}
.cite-pill:hover, .cite-pill:active {
  background-color: #d97706;
  color: #ffffff;
  border-color: #b45309;
}

/* Resolution Stepper Dial */
.stepper-btn {
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.stepper-btn.active {
  background-color: #d97706;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.3);
}
.dark .stepper-btn.active {
  background-color: #f59e0b;
  color: #1e293b;
  font-weight: 700;
}

/* Inline Node Resolution Stepper */
.node-stepper-btn {
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.15s ease;
}
.node-stepper-btn.node-active-tier {
  background-color: #d97706;
  color: #ffffff;
  font-weight: 700;
}
.dark .node-stepper-btn.node-active-tier {
  background-color: #f59e0b;
  color: #0f172a;
  font-weight: 700;
}

/* L3 KaTeX Mathematical Formulation Cards */
.math-card {
  background-color: #0f172a;
  border: 1px solid #1e293b;
  color: #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
}
.math-card .katex-display {
  margin: 0.5em 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.math-card .katex {
  font-size: 1.05em;
  color: #fbbf24;
}

/* L0 Outline Axiom Display */
.l0-axiom-quote {
  font-family: 'Newsreader', Georgia, serif;
  font-style: normal;
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.65;
  border-left: 3px solid #d97706;
  padding-left: 1rem;
  margin: 0.4rem 0;
}

/* Drawer transitions and dragging states */
#vault-drawer {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#dock-content-area {
  transition: max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#vault-drawer.drawer-is-dragging,
#vault-drawer.drawer-is-dragging #dock-content-area {
  transition: none !important;
  user-select: none;
}

#vault-drag-handle {
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  cursor: grab;
}

#vault-drag-handle:active,
#vault-drawer.drawer-is-dragging #vault-drag-handle {
  cursor: grabbing;
}

/* In-App Mobile Console */
#mobile-console-modal {
  backdrop-filter: blur(8px);
}

/* Author Grouping & Footnote UI */
.vault-author-header {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.author-chip-filter {
  transition: all 0.15s ease;
  font-family: 'JetBrains Mono', monospace;
}

.author-chip-filter.active-filter {
  background-color: #d97706;
  color: #ffffff;
  border-color: #b45309;
}

.btn-topic-footnote {
  transition: all 0.15s ease;
}

.btn-topic-footnote:hover {
  transform: translateY(-1px);
}

