/* ============================================================
   Wishur Wiki — styles
   ============================================================ */
:root {
  --primary: #FF6A00;
  --secondary: #C94700;
  --bg: #0B0B0B;
  --surface: #151515;
  --text: #FFFFFF;
  --muted: #A0A0A0;
  --border: rgba(255,106,0,.2);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* ---- FONTS ---- */
body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html.light body { background-color: #fbfbfb; color: #151515; }
.font-heading { font-family: 'Unbounded', system-ui, sans-serif; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #262626; border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
html.light ::-webkit-scrollbar-track { background: #f0f0f0; }
html.light ::-webkit-scrollbar-thumb { background: #ccc; border-color: #f0f0f0; }

/* ---- BACKGROUND ---- */
.bg-grid {
  background-size: 48px 48px;
  background-image:
    linear-gradient(to right, rgba(255,106,0,.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,106,0,.05) 1px, transparent 1px);
}
html.light .bg-grid {
  background-image:
    linear-gradient(to right, rgba(255,106,0,.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,106,0,.08) 1px, transparent 1px);
}
.orb-bg {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}
.orb { position: absolute; border-radius: 50%; filter: blur(120px); }
.orb-1 {
  width: 550px; height: 550px; background: rgba(255,106,0,.15);
  top: -100px; left: -120px;
  animation: liquid1 28s ease-in-out infinite;
}
.orb-2 {
  width: 650px; height: 650px; background: rgba(201,71,0,.15);
  bottom: -140px; right: -100px;
  animation: liquid2 36s ease-in-out infinite;
}
html.light .orb { opacity: .28; }
@keyframes liquid1 { 0%,100%{transform:translate(0,0) scale(1);}33%{transform:translate(70px,40px) scale(1.12);}66%{transform:translate(-40px,70px) scale(.92);} }
@keyframes liquid2 { 0%,100%{transform:translate(0,0) scale(1);}33%{transform:translate(-60px,-50px) scale(1.08);}66%{transform:translate(50px,-70px) scale(.96);} }

/* ---- PRELOADER ---- */
.wiki-preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s cubic-bezier(.16,1,.3,1), visibility .5s;
}
.wiki-preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
html.light .wiki-preloader { background: #fbfbfb; }
.preloader-inner { text-align: center; width: 260px; }
.preloader-logo {
  width: 72px; height: 72px; margin: 0 auto 1.5rem;
  border-radius: 1.25rem; background: var(--surface);
  border: 1px solid rgba(255,106,0,.4);
  display: flex; align-items: center; justify-content: center; padding: .6rem;
  animation: pulseGlow 2s ease-in-out infinite;
}
html.light .preloader-logo { background: #fff; }
.preloader-logo img { width: 100%; height: 100%; object-fit: contain; }
@keyframes pulseGlow {
  0%,100% { box-shadow: 0 0 20px rgba(255,106,0,.25); }
  50% { box-shadow: 0 0 40px rgba(255,106,0,.55); }
}
.preloader-title {
  font-size: 1.1rem; font-weight: 800; letter-spacing: .15em;
  color: #fff; margin-bottom: 1.25rem;
}
html.light .preloader-title { color: #151515; }
.preloader-title .accent { color: var(--primary); }
.preloader-bar {
  height: 3px; border-radius: 2px; background: rgba(255,106,0,.15);
  overflow: hidden; margin-bottom: 1rem;
}
.preloader-bar span {
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: barSlide 1.2s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes barSlide { 0%{transform:translateX(-100%);}100%{transform:translateX(300%);} }
.preloader-sub {
  font-size: .7rem; color: var(--muted); letter-spacing: .1em;
  text-transform: uppercase; font-family: 'Unbounded', sans-serif;
}

/* ---- GLASS PANEL ---- */
.glass-panel {
  background: rgba(21,21,21,.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px 0 rgba(0,0,0,.5);
}
html.light .glass-panel {
  background: rgba(255,255,255,.85);
  border-color: rgba(255,106,0,.25);
  box-shadow: 0 8px 32px 0 rgba(255,106,0,.08);
}

/* ---- HEADER ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  background: rgba(11,11,11,.6);
  border-bottom: 1px solid var(--border);
  padding: .875rem .75rem;
}
html.light .site-header { background: rgba(255,255,255,.9); }
.header-inner {
  max-width: 80rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand-logo {
  width: 40px; height: 40px; border-radius: .75rem;
  background: var(--surface); border: 1px solid rgba(255,106,0,.4);
  display: flex; align-items: center; justify-content: center; padding: .25rem;
  box-shadow: 0 0 15px rgba(255,106,0,.3);
  transition: border-color .3s;
}
.brand:hover .brand-logo { border-color: var(--primary); }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-name {
  font-size: 1.15rem; font-weight: 800; letter-spacing: .08em;
  color: #fff; white-space: nowrap;
}
html.light .brand-name { color: #151515; }
.brand-tag {
  padding: .125rem .5rem; border-radius: .375rem;
  background: rgba(255,106,0,.15); border: 1px solid rgba(255,106,0,.3);
  font-size: .625rem; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .1em;
}
.header-actions { display: flex; align-items: center; gap: .4rem; }

/* header-btn: явные размеры svg */
.header-btn {
  height: 36px; padding: 0 .75rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: .75rem; background: var(--surface);
  border: 1px solid rgba(255,106,0,.25);
  color: var(--primary); text-decoration: none; cursor: pointer;
  font-family: 'Unbounded', sans-serif; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  transition: all .2s;
}
.header-btn:hover { color: #fff; border-color: var(--primary); background: rgba(201,71,0,.3); }
html.light .header-btn { background: #fff; }
html.light .header-btn:hover { color: #151515; }
.header-btn.icon-only { padding: 0; width: 36px; }
.header-btn .icon { width: 16px; height: 16px; flex-shrink: 0; display: block; }
.header-btn .btn-label { display: none; }
@media (min-width: 640px) {
  .header-btn .btn-label { display: inline; }
}

/* ---- LAYOUT ---- */
.wiki-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  width: 100%;
  flex: 1;
  position: relative; z-index: 10;
}
@media (max-width: 900px) {
  .wiki-layout { grid-template-columns: 1fr; padding: 1rem .5rem; }
}

/* ---- SIDEBAR ---- */
.wiki-sidebar {
  align-self: start; position: sticky; top: 80px;
  max-height: calc(100vh - 100px); overflow-y: auto;
  padding: 1rem; border-radius: 1rem;
}
@media (max-width: 900px) {
  .wiki-sidebar { position: static; max-height: none; }
}
.wiki-sidebar::-webkit-scrollbar { width: 6px; }
.wiki-sidebar::-webkit-scrollbar-thumb { background: rgba(255,106,0,.3); border-radius: 3px; }

.section-label {
  font-family: 'Unbounded', sans-serif; font-size: .65rem; font-weight: 700;
  color: var(--primary); text-transform: uppercase; letter-spacing: .1em;
  margin: 0 0 .5rem;
}

/* ---- SEARCH ---- */
.search-wrap { position: relative; margin-bottom: 1rem; }
.search-input {
  width: 100%; padding: .7rem 1rem .7rem 2.4rem;
  background: rgba(21,21,21,.6); border: 1px solid rgba(255,106,0,.25);
  border-radius: .75rem; color: #fff; font-size: .85rem;
  outline: none; transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,106,0,.15); }
html.light .search-input { background: #fff; color: #151515; }
.search-icon {
  position: absolute; left: .8rem; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--primary); pointer-events: none;
}
.search-results {
  position: absolute; top: calc(100% + .4rem); left: 0; right: 0;
  background: var(--surface); border: 1px solid rgba(255,106,0,.3);
  border-radius: .75rem; max-height: 320px; overflow-y: auto;
  z-index: 30; display: none;
}
html.light .search-results { background: #fff; }
.search-results.show { display: block; }
.search-result {
  padding: .6rem .9rem; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: .82rem; transition: background .15s;
}
.search-result:hover, .search-result.sel { background: rgba(255,106,0,.15); }
.search-result .sr-title { color: #fff; font-weight: 600; }
html.light .search-result .sr-title { color: #151515; }
.search-result .sr-path {
  color: var(--primary); font-size: .7rem; margin-top: .1rem;
  font-family: 'Unbounded', sans-serif;
}
.search-empty { padding: 1rem; text-align: center; color: var(--muted); font-size: .8rem; }

/* ---- TREE ---- */
.tree-dir {
  margin-left: .75rem; border-left: 1px dashed rgba(255,106,0,.25);
  padding-left: .5rem;
}
.tree-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .6rem; border-radius: .5rem;
  cursor: pointer; font-size: .82rem; color: #d1d5db;
  transition: background .2s, color .2s;
  user-select: none;
}
.tree-item:hover { background: rgba(255,106,0,.12); color: #fff; }
.tree-item.active { background: rgba(255,106,0,.22); color: var(--primary); font-weight: 600; }
.tree-item .chev { transition: transform .25s; flex-shrink: 0; }
.tree-item.collapsed .chev { transform: rotate(-90deg); }
.tree-item .tree-icon { width: 14px; height: 14px; flex-shrink: 0; color: var(--primary); }
html.light .tree-item { color: #333; }
html.light .tree-item:hover { background: rgba(255,106,0,.12); color: #151515; }
html.light .tree-item.active { background: rgba(255,106,0,.2); color: var(--secondary); }
.tree-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- ARTICLE PANEL (БЕЗ лишней рамки) ---- */
.article-panel {
  border-radius: 1rem;
  padding: 2rem 2rem;
  min-height: 60vh;
}
@media (max-width: 640px) {
  .article-panel { padding: 1.25rem; }
}

/* ---- BREADCRUMBS — без рамки, только текст ---- */
.breadcrumbs {
  font-size: .7rem;
  font-family: 'Unbounded', sans-serif;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
  letter-spacing: .03em;
}
.breadcrumbs:empty { display: none; }
.breadcrumbs .crumb-sep { color: var(--muted); opacity: .6; }
.breadcrumbs .crumb-muted { color: var(--muted); }
.breadcrumbs .crumb-current { color: #fff; }
html.light .breadcrumbs .crumb-current { color: #151515; }

/* ---- WELCOME CARD — чистый, без рамки ---- */
.welcome-card {
  text-align: center;
  padding: 3rem 1rem;
}
.welcome-icon {
  width: 72px; height: 72px; margin: 0 auto 1rem;
  border-radius: 1rem; background: var(--surface);
  border: 1px solid rgba(255,106,0,.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.welcome-icon svg { width: 36px; height: 36px; }
.welcome-card h1 {
  font-size: 1.5rem; font-weight: 800; color: #fff;
  margin: 0 0 .5rem; line-height: 1.3;
}
html.light .welcome-card h1 { color: #151515; }
.welcome-card p {
  color: var(--muted); font-size: .875rem;
  max-width: 28rem; margin: 0 auto; line-height: 1.6;
}

/* ---- MARKDOWN / ARTICLE BODY ---- */
.article-body {
  font-size: .95rem; line-height: 1.75; color: #d1d5db;
  word-wrap: break-word;
}
html.light .article-body { color: #333; }
.article-body > *:first-child { margin-top: 0; }
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  font-family: 'Unbounded', sans-serif;
  color: #fff; line-height: 1.3;
  margin: 1.6rem 0 .7rem;
}
html.light .article-body h1,
html.light .article-body h2,
html.light .article-body h3,
html.light .article-body h4 { color: #151515; }
.article-body h1 { font-size: 1.75rem; }
.article-body h2 { font-size: 1.35rem; color: var(--primary); }
html.light .article-body h2 { color: var(--secondary); }
.article-body h3 { font-size: 1.1rem; }
.article-body h4 { font-size: 1rem; }
.article-body p { margin: 0 0 .9rem; }
.article-body ul, .article-body ol { margin: 0 0 1rem 1.4rem; padding: 0; }
.article-body li { margin-bottom: .3rem; }
.article-body strong { color: #fff; font-weight: 700; }
html.light .article-body strong { color: #151515; }
.article-body em { color: var(--primary); font-style: italic; }
.article-body code {
  background: rgba(255,106,0,.12); color: var(--primary);
  padding: .1rem .4rem; border-radius: .3rem;
  font-size: .85em; font-family: 'Courier New', monospace;
}
.article-body pre {
  background: #0f0f0f; border: 1px solid rgba(255,106,0,.2);
  padding: 1rem; border-radius: .6rem; overflow-x: auto;
  margin: 0 0 1rem;
}
html.light .article-body pre { background: #f5f5f5; }
.article-body pre code { background: none; color: inherit; padding: 0; }
.article-body a { color: var(--primary); text-decoration: underline; }
.article-body a:hover { text-decoration: none; }
.article-body img { max-width: 100%; border-radius: .6rem; margin: .5rem 0; }
.article-body blockquote {
  border-left: 3px solid var(--primary); padding: .5rem 1rem;
  margin: 1rem 0; color: var(--muted); font-style: italic;
  background: rgba(255,106,0,.05); border-radius: 0 .5rem .5rem 0;
}
.article-body table {
  border-collapse: collapse; width: 100%; margin: 0 0 1rem;
}
.article-body th, .article-body td {
  border: 1px solid rgba(255,106,0,.2);
  padding: .5rem .75rem; text-align: left;
}
.article-body th {
  background: rgba(255,106,0,.1); color: var(--primary); font-weight: 700;
}
.article-body hr {
  border: none; border-top: 1px solid rgba(255,106,0,.25); margin: 1.5rem 0;
}

/* ---- FOOTER ---- */
.site-footer {
  position: relative; z-index: 10;
  border-top: 1px solid rgba(255,106,0,.15);
  background: rgba(11,11,11,.9);
  backdrop-filter: blur(8px);
  padding: 1.5rem 1rem; margin-top: 2rem;
}
html.light .site-footer { background: rgba(255,255,255,.92); }
.footer-inner {
  max-width: 80rem; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; font-size: .75rem; color: var(--muted);
}
.footer-brand { display: flex; align-items: center; gap: .5rem; }
.footer-brand .font-heading { color: #fff; font-weight: 600; }
html.light .footer-brand .font-heading { color: #151515; }
.version-badge {
  font-size: .7rem; padding: .125rem .5rem; border-radius: .25rem;
  background: var(--surface); border: 1px solid rgba(255,255,255,.05);
}
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: inherit; text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--primary); }