:root{
  --bg:#0b0c10; --text-strong:#fff; --text-muted:#d1d5db;
  --accent:#fbbf24; --accent-hover:#ffd65c; --hover:rgba(250,250,250,.08);
}
body.theme-light{
  --bg:#fff; --text-strong:#111; --text-muted:#374151;
  --accent:#f59e0b; --accent-hover:#fbbf24; --hover:rgba(15,23,42,.06);
}
*{box-sizing:border-box}
body{
  margin:0;color:var(--text-strong);background:var(--bg);
  font-family:"Vazirmatn",system-ui,-apple-system,"Segoe UI",Arial,sans-serif
}

/* ===== Topbar (full-width glass) ===== */
.topbar{
  position: fixed; top: 0; right: 0; left: 0; width: 100%;
  background: rgba(255,255,255,.06);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  z-index: 9999;
}
body.theme-light .topbar{
  background: rgba(255,255,255,.65);
  box-shadow: 0 8px 20px rgba(0,0,0,.1);
}
.topbar-inner{
  width: min(1200px, 100% - 32px);
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0;
}
.topbar-spacer{ height: 74px; }

.site-nav ul{
  list-style:none;margin:0;padding:0;
  display:flex;gap:.5rem;align-items:center;flex-wrap:wrap
}
.site-nav a{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.55rem .95rem;border-radius:10px;
  color:var(--text-muted);font-weight:800;text-decoration:none;font-size:15px;
  transition:background .25s,color .25s
}
.site-nav a:hover,
.site-nav a:focus{
  color:var(--text-strong);background:var(--accent-hover)
}
.site-nav li.current-menu-item > a,
.site-nav li.current_page_item > a,
.site-nav li.current-menu-ancestor > a,
.site-nav li.current_page_parent > a,
.site-nav li.current_page_ancestor > a,
.site-nav li.is-current > a{
  background:var(--accent) !important;
  color:#000 !important;
}
.site-nav li.current-menu-item > a:hover,
.site-nav li.current_page_item > a:hover,
.site-nav li.current-menu-ancestor > a:hover,
.site-nav li.current_page_parent > a:hover,
.site-nav li.current_page_ancestor > a:hover,
.site-nav li.is-current > a:hover{
  background:var(--accent-hover) !important;
  color:#000 !important;
}

.site-nav a .em{display:inline-block;transition:transform .3s ease}
.site-nav a:hover .em{animation:floatIcon .6s ease-in-out infinite}
@keyframes floatIcon{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}

.group.social{display:flex;align-items:center;gap:12px}
.pill{
  display:inline-flex;align-items:center;gap:.2rem;padding:.5rem;
  border-radius:12px;border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.04);color:inherit;text-decoration:none;font-weight:800;
  transition:background .25s,color .25s,border-color .25s
}
.pill .ico{width:18px;height:18px;color:currentColor;display:block}
.pill.telegram:hover{background:#229ED9;color:#fff;border-color:transparent}
.pill.instagram:hover{background:#f78026;color:#fff;border-color:transparent}
body.theme-light .pill{border-color:rgba(0,0,0,.12);background:rgba(0,0,0,.04)}
body.theme-light .pill:hover{border-color:rgba(0,0,0,.12);background:rgba(0,0,0,.08)}

.theme-switch--circle{position:relative}
.theme-switch--circle input{position:absolute;opacity:0;width:0;height:0}
.theme-switch--circle .circle{
  width:42px;height:42px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:var(--hover);
  border:2px solid rgba(255,255,255,.25);
  cursor:pointer;transition:background .25s,border-color .25s,transform .12s
}
.theme-switch--circle .circle:active{transform:scale(.95)}
.theme-switch--circle .icon{font-size:18px;line-height:1;display:none}
.theme-switch--circle .icon.moon{display:inline-block}
body.theme-light .theme-switch--circle .circle{background:#f9f9f9; border-color:rgba(0,0,0,.12)}
body.theme-light .theme-switch--circle .icon.moon{display:none}
body.theme-light .theme-switch--circle .icon.sun{display:inline-block}

html.theme-light body,
html.theme-light #page,
html.theme-light .site,
html.theme-light .site-main,
html.theme-light .container,
html.theme-light .wrap,
html.theme-light .wrapper{background:#fff!important;color:#111!important}
html:not(.theme-light) body,
html:not(.theme-light) #page,
html:not(.theme-light) .site,
html:not(.theme-light) .site-main,
html:not(.theme-light) .container,
html:not(.theme-light) .wrap,
html:not(.theme-light) .wrapper{background:#0b0c10!important;color:#fff!important}

.theme-switch--circle{transform:translateX(20px)}
:root{--accent-hover:#e0b000}

body.theme-light .pill.telegram:hover{background:#229ED9;color:#fff;border-color:transparent}
body.theme-light .pill.instagram:hover{background:#f78026;color:#fff;border-color:transparent}

.site-logo--mobile{ display:block; }

/* ===== MOBILE (<=767px) ===== */
@media (max-width: 767px){

  :root{
    --bg:#0b0c10; --text-strong:#fff; --text-muted:#d1d5db;
    --accent:#fbbf24; --accent-hover:#ffd65c; --hover:rgba(250,250,250,.08);
  }
  body.theme-light{
    --bg:#fff; --text-strong:#111; --text-muted:#374151;
    --accent:#f59e0b; --accent-hover:#fbbf24; --hover:rgba(15,23,42,.06);
  }
  
  .topbar{
    height: 56px;
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    box-shadow: 0 6px 18px rgba(0,0,0,.15);
  }
  body.theme-light .topbar{
    background: rgba(255,255,255,.9);
    box-shadow: 0 6px 16px rgba(0,0,0,.1);
  }
  .topbar-inner{
    width: calc(100% - 24px);
    margin: 0 auto;
    height: 100%;
    padding: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
  }
  .topbar-spacer{ height: 56px; }

  .site-logo--mobile{ display: block; }
  .site-logo--mobile img{
    width:80px; height:auto; display:block; object-fit:contain;
    margin:0 !important; padding:0 !important;
  }

  .menu-toggle,
  .search-toggle,
  .theme-switch--circle{
    width: 38px; height: 38px; flex: 0 0 38px;
  }

  .menu-toggle{
    display:inline-flex; align-items:center; justify-content:center;
    width:42px; height:42px; border-radius:12px;
    border:2px solid rgba(255,255,255,.25);
    background:var(--hover); color:inherit; cursor:pointer;
  }
  body.theme-light .menu-toggle{border-color:rgba(0,0,0,.12); background:rgba(0,0,0,.06)}
  .menu-toggle .bars{display:block;width:20px;height:2px;background:currentColor;position:relative}
  .menu-toggle .bars::before,.menu-toggle .bars::after{
    content:""; position:absolute; left:0; right:0; height:2px; background:currentColor
  }
  .menu-toggle .bars::before{top:-6px}
  .menu-toggle .bars::after{top:6px}

  .site-nav{
    position:fixed; top:56px; right:0; left:0;
    background:rgba(15,23,42,.98);
    border-top:1px solid rgba(255,255,255,.08);
    max-height:0; overflow:hidden; transition:max-height .28s ease;
  }
  body.theme-light .site-nav{
    background:rgba(255,255,255,.98);
    border-top:1px solid rgba(0,0,0,.08);
  }
  .site-nav.open{max-height:calc(100vh - 56px)}
  .site-nav ul{
    list-style:none; margin:8px; padding:0;
    display:flex; flex-direction:column; gap:6px;
  }
  .site-nav a{
    display:flex; align-items:center; gap:.5rem;
    width:100%; padding:.9rem 1rem; border-radius:12px;
    color:var(--text-muted); font-weight:800; text-decoration:none; font-size:16px;
    transition:background .25s,color .25s;
  }
  .site-nav a:hover{color:var(--text-strong); background:var(--accent-hover)}
  .site-nav li.current-menu-item > a,
  .site-nav li.current_page_item > a,
  .site-nav li.current-menu-ancestor > a,
  .site-nav li.current_page_parent > a,
  .site-nav li.current_page_ancestor > a,
  .site-nav li.is-current > a{
    background:var(--accent); color:#000;
  }

  .group.social{margin-inline-start:auto; display:flex; align-items:center; gap:8px}
  .pill{display:none}
  .theme-switch--circle .circle{width:38px; height:38px}
  body.theme-light .theme-switch--circle .circle{background:#f9f9f9; border-color:rgba(0,0,0,.12)}
  .theme-switch--circle .icon{display:none; font-size:18px}
  .theme-switch--circle .icon.moon{display:inline-block}
  body.theme-light .theme-switch--circle .icon.moon{display:none}
  body.theme-light .theme-switch--circle .icon.sun{display:inline-block}

  .search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.25s ease;
  }
  html.theme-light .search-toggle {
    background-color: rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(0, 0, 0, 0.28);
  }
  .search-toggle svg {
    width: 18px;
    height: 18px;
    stroke: #ffc107;
    transition: transform 0.25s ease, stroke 0.25s ease;
  }
  .search-toggle:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
  }
  html.theme-light .search-toggle:hover {
    background-color: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.35);
  }
}

@media (max-width: 767px){
  .mobile-search{
    position: fixed;
    top: 56px; right: 0; left: 0;
    z-index: 10000;
    background: rgba(28,30,34,.92);
    border-top: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 18px rgba(0,0,0,.18);
    padding: 0;
    border: 0;
  }
  html.theme-light .mobile-search{
    background: #fff;
    border-top: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 6px 14px rgba(0,0,0,.06);
  }

  .mobile-search form{ margin: 0; position: relative; }

  .mobile-search input[type="search"]{
    width: 100%;
    height: 48px;
    padding: 0 16px;
    padding-left: 48px !important;
    border: 0 !important;
    outline: none !important;
    border-radius: 0 !important;
    background: transparent;
    box-shadow: none !important;
    -webkit-appearance: none; appearance: none;

    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    direction: rtl;
    text-align: right;
    caret-color: #ffc107;
    letter-spacing: .2px;
    text-overflow: clip;
    color:#e5e7eb;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  html.theme-light .mobile-search input[type="search"]{
    color:#333 !important;
    background:#fff;
    font-weight: 500;
  }

  .mobile-search input::placeholder{
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: rgba(229,231,235,.8);
    opacity: 1;
  }
  html.theme-light .mobile-search input::placeholder{
    color: #1f2937 !important;
    opacity: 1 !important;
    font-weight: 600;
  }
  /* Vendor prefixes */
  html.theme-light .mobile-search input::-webkit-input-placeholder{ color:#1f2937 !important; opacity:1 !important; font-weight:600; }
  html.theme-light .mobile-search input::-moz-placeholder{ color:#1f2937 !important; opacity:1 !important; font-weight:600; }
  html.theme-light .mobile-search input:-ms-input-placeholder{ color:#1f2937 !important; opacity:1 !important; font-weight:600; }

  body:not(.light-mode) .mobile-search form::before,
  body.light-mode .mobile-search form::before{
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 22px; height: 22px;
    transform: translateY(-50%);
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: 22px 22px;
    opacity: .75;
  }
  body:not(.light-mode) .mobile-search form::before{
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cfcfcf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
  }
  body.light-mode .mobile-search form::before{
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
    opacity: .7;
  }

  .topbar-inner{ justify-content:space-between; }
  .group.social{ margin-inline-start:auto; gap:8px; }
}

@media (min-width:768px){
  .menu-toggle{ display:none !important; }
  .search-toggle{ display:none !important; }
  .mobile-search{ display:none !important; }
  .site-logo--mobile{ display:none !important; }
}
