/* ═══════════════════════════════════════════
   fennec — UNIVERSAL STYLES
   Import on every page: <link rel="stylesheet" href="/static/fennec.css">
═══════════════════════════════════════════ */

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

/* ── TOKENS ── */
:root {
  --black:   #080808;
  --white:   #f2f0e8;
  --lime:    #c8f135;
  --purple:  #7c5cfc;
  --red:     #ff3b3b;
  --border:  1px solid rgba(242,240,232,0.14);
  --border-strong: 1px solid rgba(242,240,232,0.35);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--black);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* ── TICKER ── */
.ticker {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: var(--lime);
  color: var(--black);
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 200;
  border-bottom: 1px solid var(--black);
  flex-shrink: 0;
}

.ticker-inner {
  display: flex;
  gap: 60px;
  white-space: nowrap;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;

  /* Анимация прокрутки */
  animation: bs-tick 20s linear infinite;
}

@keyframes bs-tick {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── LAYOUT HELPERS ── */
.bs-page {
  min-height: calc(100vh - 30px);
  margin-top: 30px;
}

/* 3-column full-height (profile, records) */
.bs-cols {
  display: grid;
  height: calc(100vh - 30px);
}
.bs-cols-3 { grid-template-columns: 320px 1fr 240px; }
.bs-cols-2 { grid-template-columns: 380px 1fr; }

.bs-col {
  height: 100%; overflow-y: auto; border-right: var(--border);
  scrollbar-width: none;
}
.bs-col::-webkit-scrollbar { display: none; }
.bs-col:last-child { border-right: none; }

/* centered single-column (login, register, password) */
.bs-center {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 30px);
  padding: 40px 20px;
}

/* ── BLOB ── */
.bs-blob {
  position: absolute; pointer-events: none; z-index: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse,
    rgba(200,241,53,0.2) 0%,
    rgba(124,92,252,0.14) 40%,
    transparent 68%);
  animation: bs-blob 9s ease-in-out infinite;
}
@keyframes bs-blob {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.08) rotate(6deg); }
}

/* ── AVATAR SQUARE ── */
.bs-avatar {
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--lime); position: relative;
}
.bs-avatar::before {
  content: ''; position: absolute; inset: 5px;
  background: linear-gradient(135deg, var(--lime) 0%, var(--purple) 100%);
}
.bs-avatar-char {
  font-family: 'Space Mono', monospace; font-weight: 700;
  color: var(--black); position: relative; z-index: 1;
}

/* ── SECTION HEADER (inside column) ── */
.bs-col-head {
  padding: 26px 32px 20px; border-bottom: var(--border);
  display: flex; justify-content: space-between; align-items: flex-end;
}
.bs-col-head-label {
  font-family: 'Space Mono', monospace; font-size: 9px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(242,240,232,0.9);
}
.bs-col-head-sub {
  font-family: 'Space Mono', monospace; font-size: 9px;
  color: rgba(242,240,232,0.5);
}

/* ── PARAM ROW ── */
.bs-param {
  padding: 0 32px; border-bottom: var(--border);
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 66px; align-items: center;
  transition: background 0.12s; cursor: default;
}
.bs-param:hover { background: rgba(242,240,232,0.025); }
.bs-param.hero {
  background: rgba(200,241,53,0.04);
  border-left: 2px solid var(--lime);
  padding-left: 30px;
}
.bs-param-k {
  font-family: 'Space Mono', monospace; font-size: 9px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(242,240,232,0.9);
}
.bs-param-v { font-size: 14px; font-weight: 500; color: var(--white); text-align: right; }
.bs-param-v.lime  { color: var(--lime); font-weight: 600; }
.bs-param-v.empty { color: rgba(242,240,232,0.4); font-style: italic; font-size: 12px; }
.bs-param-v.mono  { font-family: 'Space Mono', monospace; font-size: 10px;
                    color: rgba(242,240,232,0.9); word-break: break-all; }

/* ── ACTION ITEM ── */
.bs-action {
  display: flex; flex-direction: column;
  padding: 18px 24px; border-bottom: var(--border);
  text-decoration: none; cursor: pointer;
  transition: background 0.12s; position: relative; overflow: hidden;
}
.bs-action::after {
  content: '→'; position: absolute; right: 24px; top: 50%;
  transform: translateY(-50%) translateX(12px);
  font-size: 16px; opacity: 0; transition: all 0.18s;
  color: var(--lime); font-family: 'Space Mono', monospace;
}
.bs-action:hover::after          { transform: translateY(-50%) translateX(0); opacity: 1; }
.bs-action:hover                 { background: rgba(242,240,232,0.025); }
.bs-action.primary:hover         { background: rgba(200,241,53,0.05); }
.bs-action.danger:hover          { background: rgba(255,59,59,0.05); }
.bs-action-num {
  font-family: 'Space Mono', monospace; font-size: 9px;
  color: rgba(242,240,232,0.9); letter-spacing: 0.1em; margin-bottom: 6px;
}
.bs-action-label {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 3px; color: var(--white);
}
.bs-action.primary .bs-action-label { color: var(--lime); }
.bs-action.danger  .bs-action-label { color: var(--red); }
.bs-action-desc { font-size: 11px; color: rgba(242,240,232,0.9); line-height: 1.4; }

/* ── TAGS ── */
.bs-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.bs-tag {
  font-family: 'Space Mono', monospace; font-size: 9px;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 9px; border: 1px solid;
}
.bs-tag-on  { border-color: var(--lime); color: var(--lime); }
.bs-tag-off { border-color: rgba(242,240,232,0.5); color: rgba(242,240,232,0.9); }

/* ── DOT ── */
.bs-dot {
  width: 6px; height: 6px; background: var(--lime);
  box-shadow: 0 0 7px var(--lime); animation: bs-blink 2s step-end infinite;
}
@keyframes bs-blink { 0%,100% { opacity:1; } 50% { opacity:0.15; } }

/* ── SCAN BAR ── */
.bs-scanbar {
  height: 2px; background: rgba(242,240,232,0.08); overflow: hidden;
}
.bs-scanbar::after {
  content: ''; display: block; height: 100%; width: 30%;
  background: var(--purple);
  animation: bs-scan 2.8s ease-in-out infinite;
}
@keyframes bs-scan { 0% { transform: translateX(-100%); } 100% { transform: translateX(430%); } }

/* ── FORM BOX (login / register / password) ── */
.bs-form-box {
  width: 100%; max-width: 420px;
  border: var(--border-strong);
  padding: 44px 40px;
  position: relative; overflow: hidden;
  animation: bs-fadein 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes bs-fadein {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bs-form-logo {
  font-family: 'Space Mono', monospace; font-size: 13px;
  font-weight: 700; letter-spacing: 0.08em; margin-bottom: 32px;
  color: var(--white);
}
.bs-form-logo span { color: var(--lime); }

.bs-form-title {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.bs-form-sub {
  font-size: 13px; color: rgba(242,240,232,0.9);
  margin-bottom: 32px; line-height: 1.5;
}

.bs-field { margin-bottom: 18px; }
.bs-field-label {
  display: block; font-family: 'Space Mono', monospace; font-size: 9px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(242,240,232,0.9); margin-bottom: 8px;
}
.bs-input {
  width: 100%; padding: 12px 14px;
  background: rgba(242,240,232,0.04);
  border: var(--border-strong);
  color: var(--white);
  font-family: 'Space Grotesk', sans-serif; font-size: 14px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
  border-radius: 0;
  -webkit-appearance: none;
}
.bs-input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 2px rgba(200,241,53,0.12);
}
.bs-input::placeholder { color: rgba(242,240,232,0.3); }

.bs-btn {
  display: block; width: 100%;
  padding: 13px 20px;
  font-family: 'Space Mono', monospace; font-size: 11px;
  font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer; border: none; outline: none;
  transition: opacity 0.15s, transform 0.15s;
  border-radius: 0;
}
.bs-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.bs-btn:active { transform: translateY(0); }

.bs-btn-primary { background: var(--lime); color: var(--black); }
.bs-btn-ghost   { background: transparent; color: var(--white); border: var(--border-strong); }
.bs-btn-danger  { background: var(--red); color: var(--white); }

.bs-form-link {
  display: block; text-align: center; margin-top: 20px;
  font-size: 12px; color: rgba(242,240,232,0.9);
}
.bs-form-link a { color: var(--lime); text-decoration: none; }
.bs-form-link a:hover { text-decoration: underline; }

.bs-divider {
  height: 1px; background: rgba(242,240,232,0.12); margin: 22px 0;
}

.bs-alert {
  padding: 11px 14px; margin-bottom: 18px; font-size: 12px;
  font-family: 'Space Mono', monospace;
}
.bs-alert-error   { border: 1px solid rgba(255,59,59,0.5); color: #ff8f9f; background: rgba(255,59,59,0.07); }
.bs-alert-success { border: 1px solid rgba(200,241,53,0.4); color: var(--lime); background: rgba(200,241,53,0.06); }

/* ── TABLE ── */
.bs-table-wrap { width: 100%; overflow-x: auto; }
.bs-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.bs-table thead tr {
  border-bottom: var(--border-strong);
}
.bs-table th {
  padding: 14px 20px; text-align: left;
  font-family: 'Space Mono', monospace; font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(242,240,232,0.9); font-weight: 700;
  white-space: nowrap;
}
.bs-table td {
  padding: 16px 20px; border-bottom: var(--border);
  vertical-align: top; color: var(--white);
}
.bs-table tbody tr { transition: background 0.12s; }
.bs-table tbody tr:hover { background: rgba(242,240,232,0.025); }
.bs-table .td-mono {
  font-family: 'Space Mono', monospace; font-size: 11px;
  color: rgba(242,240,232,0.9);
}
.bs-table .td-transcription {
  max-width: 360px; font-size: 13px;
  color: rgba(242,240,232,0.9); line-height: 1.5;
}
.bs-table .td-empty {
  color: rgba(242,240,232,0.35); font-style: italic; font-size: 12px;
}
.bs-table .td-url a {
  color: var(--lime); font-size: 12px;
  font-family: 'Space Mono', monospace;
  word-break: break-all;
}
.bs-table .td-url a:hover { text-decoration: underline; }

/* ── BIG NUMBER ── */
.bs-big-num {
  font-family: 'Space Mono', monospace; font-size: 3.6rem;
  font-weight: 700; color: var(--lime); line-height: 1; letter-spacing: -0.05em;
}
.bs-big-desc {
  font-size: 11px; color: rgba(242,240,232,0.9);
  margin-top: 6px; text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── BRAND TAG ── */
.bs-brand-tag {
  font-family: 'Space Mono', monospace; font-size: 9px;
  letter-spacing: 0.22em; color: rgba(242,240,232,0.9);
  text-transform: uppercase;
}

/* ── FOOTER LINE ── */
.bs-col-footer {
  padding: 14px 32px; border-top: var(--border);
  display: flex; justify-content: space-between; align-items: center;
}

/* ── ANIMATION ── */
.bs-anim { animation: bs-fadein 0.5s cubic-bezier(0.22,1,0.36,1) both; }
.bs-anim-1 { animation-delay: 0.07s; }
.bs-anim-2 { animation-delay: 0.14s; }

/* ═══ MOBILE ═══ */
@media (max-width: 768px) {
  .bs-cols, .bs-cols-3, .bs-cols-2 {
    display: block; height: auto;
  }
  .bs-col {
    height: auto; border-right: none;
    border-bottom: var(--border); overflow-y: visible;
  }
  .bs-col:last-child { border-bottom: none; }
  .bs-col-head { padding: 18px 20px 14px; }
  .bs-param    { padding: 0 20px; }
  .bs-param.hero { padding-left: 18px; }
  .bs-action   { padding: 16px 20px; }
  .bs-action::after { right: 20px; }
  .bs-form-box { padding: 32px 24px; }
  .bs-table th, .bs-table td { padding: 12px 14px; }
  .bs-table .td-transcription { max-width: 200px; }
}
    /* Obsidian-style documentation layout */
    .wiki-layout {
	display: flex;
	min-height: calc(100vh - 30px);
	position: relative;
    }

    /* Sidebar - как в Obsidian */
    .wiki-sidebar {
	width: 280px;
	background: rgba(8, 8, 8, 0.95);
	border-right: var(--border);
	position: fixed;
	left: 0;
	top: 30px;
	bottom: 0;
	overflow-y: auto;
	z-index: 10;
    }

    .wiki-sidebar-header {
	padding: 24px 20px;
	border-bottom: var(--border);
    }

    .wiki-sidebar-title {
	font-family: 'Space Mono', monospace;
	font-size: 11px;
	letter-spacing: 0.2em;
	color: var(--lime);
	margin-bottom: 8px;
    }

    .wiki-sidebar-logo {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.02em;
    }

    .wiki-sidebar-logo span {
	color: var(--lime);
    }

    .wiki-nav {
	padding: 20px 0;
    }

    .wiki-nav-section {
	margin-bottom: 24px;
    }

    .wiki-nav-section-title {
	padding: 8px 20px;
	font-family: 'Space Mono', monospace;
	font-size: 10px;
	letter-spacing: 0.1em;
	color: rgba(242,240,232,0.5);
	text-transform: uppercase;
    }

    .wiki-nav-item {
	display: block;
	padding: 8px 20px 8px 32px;
	color: rgba(242,240,232,0.8);
	font-size: 14px;
	transition: all 0.15s;
	border-left: 2px solid transparent;
	cursor: pointer;
    }

    .wiki-nav-item:hover {
	background: rgba(200,241,53,0.05);
	color: var(--lime);
    }

    .wiki-nav-item.active {
	border-left-color: var(--lime);
	color: var(--lime);
	background: rgba(200,241,53,0.08);
    }

    .wiki-nav-item-sub {
	padding-left: 48px;
	font-size: 13px;
    }

    /* Main content area */
    .wiki-main {
	flex: 1;
	margin-left: 280px;
	min-height: calc(100vh - 30px);
    }

    .wiki-content {
	max-width: 900px;
	margin: 0 auto;
	padding: 40px 48px;
    }

    /* Header styles */
    .wiki-header {
	margin-bottom: 48px;
	border-bottom: var(--border-strong);
	padding-bottom: 24px;
    }

    .wiki-title {
	font-size: 3rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin-bottom: 12px;
    }

    .wiki-title span {
	color: var(--lime);
    }

    .wiki-subtitle {
	font-size: 1.1rem;
	color: rgba(242,240,232,0.7);
	font-family: 'Space Mono', monospace;
	letter-spacing: 0.02em;
    }

    /* Section styles */
    .wiki-section {
	margin-bottom: 64px;
	scroll-margin-top: 30px;
    }

    .wiki-section-title {
	font-size: 1.8rem;
	font-weight: 600;
	margin-bottom: 28px;
	padding-left: 16px;
	border-left: 3px solid var(--lime);
    }

    .wiki-section-title h2 {
	font-size: inherit;
	font-weight: inherit;
    }

    /* Card styles */
    .wiki-card {
	background: rgba(242,240,232,0.02);
	border: var(--border);
	padding: 28px;
	margin-bottom: 28px;
	transition: all 0.2s ease;
    }

    .wiki-card:hover {
	background: rgba(242,240,232,0.04);
	border-color: rgba(200,241,53,0.3);
    }

    .wiki-card-title {
	font-size: 1.3rem;
	font-weight: 600;
	margin-bottom: 16px;
	color: var(--lime);
    }

    .wiki-text {
	line-height: 1.6;
	color: rgba(242,240,232,0.9);
	margin-bottom: 16px;
    }

    .wiki-text p {
	margin-bottom: 12px;
    }

    .wiki-code {
	background: rgba(0,0,0,0.4);
	border: var(--border);
	padding: 16px;
	font-family: 'Space Mono', monospace;
	font-size: 13px;
	overflow-x: auto;
	margin: 16px 0;
	color: var(--lime);
    }

    .wiki-list {
	margin: 16px 0;
	padding-left: 24px;
    }

    .wiki-list li {
	margin: 8px 0;
	line-height: 1.5;
    }

    .wiki-badge {
	display: inline-block;
	padding: 4px 12px;
	font-family: 'Space Mono', monospace;
	font-size: 10px;
	letter-spacing: 0.1em;
	background: rgba(200,241,53,0.1);
	border: 1px solid var(--lime);
	color: var(--lime);
	margin-right: 8px;
	margin-bottom: 8px;
    }

    .wiki-image {
	margin: 28px 0;
	text-align: center;
    }

    .wiki-image img {
	max-width: 100%;
	border: var(--border);
	background: rgba(0,0,0,0.3);
    }

    .wiki-image-caption {
	font-size: 12px;
	color: rgba(242,240,232,0.6);
	margin-top: 8px;
	font-family: 'Space Mono', monospace;
    }

    .wiki-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 24px;
	margin: 32px 0;
    }

    .wiki-feature {
	border: var(--border);
	padding: 24px;
	text-align: center;
	transition: all 0.2s;
    }

    .wiki-feature:hover {
	border-color: var(--lime);
	transform: translateY(-2px);
    }

    .wiki-feature-icon {
	font-size: 2.5rem;
	margin-bottom: 12px;
    }

    .wiki-feature-title {
	font-weight: 600;
	margin-bottom: 8px;
	color: var(--lime);
    }

    hr {
	border: none;
	height: 1px;
	background: rgba(242,240,232,0.12);
	margin: 32px 0;
    }

    /* Table of contents inside content */
    .wiki-toc {
	background: rgba(242,240,232,0.02);
	border: var(--border);
	padding: 20px;
	margin-bottom: 48px;
    }

    .wiki-toc-title {
	font-family: 'Space Mono', monospace;
	font-size: 11px;
	letter-spacing: 0.2em;
	margin-bottom: 16px;
	color: var(--lime);
    }

    .wiki-toc-list {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	list-style: none;
	padding: 0;
    }

    .wiki-toc-list li a {
	font-size: 13px;
	transition: color 0.2s;
    }

    .wiki-toc-list li a:hover {
	color: var(--lime);
    }

    /* Scrollbar */
    .wiki-sidebar::-webkit-scrollbar {
	width: 4px;
    }

    .wiki-sidebar::-webkit-scrollbar-track {
	background: rgba(242,240,232,0.05);
    }

    .wiki-sidebar::-webkit-scrollbar-thumb {
	background: var(--lime);
    }

    /* Mobile */
    @media (max-width: 768px) {
	.wiki-sidebar {
	    transform: translateX(-100%);
	    transition: transform 0.3s;
	    z-index: 100;
	}

	.wiki-sidebar.open {
	    transform: translateX(0);
	}

	.wiki-main {
	    margin-left: 0;
	}

	.wiki-content {
	    padding: 24px 20px;
	}

	.menu-toggle {
	    display: block;
	    position: fixed;
	    bottom: 20px;
	    right: 20px;
	    z-index: 101;
	    background: var(--lime);
	    color: var(--black);
	    padding: 12px;
	    border-radius: 0;
	    cursor: pointer;
	    font-family: 'Space Mono', monospace;
	    font-size: 12px;
	}
    }

    @media (min-width: 769px) {
	.menu-toggle {
	    display: none;
	}
    }

    /* Active section highlighting */
    .wiki-section {
	transition: opacity 0.3s;
    }

    /* Back to top button */
    .back-to-top {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background: rgba(200,241,53,0.1);
	border: 1px solid var(--lime);
	color: var(--lime);
	padding: 10px 15px;
	font-family: 'Space Mono', monospace;
	font-size: 11px;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.3s;
	z-index: 90;
    }

    .back-to-top.visible {
	opacity: 1;
    }

    .back-to-top:hover {
	background: rgba(200,241,53,0.2);
    }
