/* ============================================================
   NEONFLUX — bilingual layer
   1. hero language switch
   2. english type scale (english runs wider, so it needs its own)
   ============================================================ */

/* ---------- 1. switch ---------- */
/* lives in the navbar, in the slot One API gave its language icon */
.nf-lang{
  position:static;align-self:center;flex:0 0 auto;
  display:inline-flex;align-items:center;gap:2px;
  margin:0 8px 0 2px;padding:3px;border-radius:9px;
  border:1px solid rgba(255,255,255,.095);
  background:rgba(10,14,22,.5);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
  font-family:var(--mono,"JetBrains Mono",monospace);
  box-shadow:0 1px 0 rgba(255,255,255,.045) inset;
  animation:nf-lang-in .7s ease-out .25s both;
}
/* the original dropdown stays in the DOM for its option clicks, never shown */
.ui.borderless.menu .nf-lang-native{display:none !important}
/* fallback only: pages with no header slot at all */
.nf-lang.nf-lang-float{
  position:absolute;top:34px;right:0;z-index:3;
  box-shadow:0 1px 0 rgba(255,255,255,.045) inset,0 12px 30px -22px #000;
}
@keyframes nf-lang-in{
  from{opacity:0;transform:translate3d(0,-7px,0)}
  to{opacity:1;transform:none}
}
.nf-lang button{
  -webkit-appearance:none;appearance:none;
  border:0;background:transparent;cursor:pointer;
  height:24px;padding:0 10px;border-radius:6px;
  font:inherit;font-size:10px;line-height:24px;
  letter-spacing:.13em;color:#8A9BB2;
  transition:color .32s var(--ease),background .32s var(--ease);
}
.nf-lang button[data-nf-lang="zh"]{letter-spacing:.06em}
.nf-lang button:hover{color:#C6D3E1}
.nf-lang button:focus-visible{outline:1px solid rgba(77,232,244,.62);outline-offset:1px}
.nf-lang button.on{
  color:#EFF3F9;background:rgba(255,255,255,.085);
  box-shadow:0 0 0 1px rgba(255,255,255,.055) inset;
}

/* ---------- 2. english type scale ---------- */
html[lang="en"] .nf-h1{
  letter-spacing:-.026em !important;
  line-height:1.035 !important;
}
html[lang="en"] .nf-sub{
  font-size:16.5px;line-height:29px;max-width:592px;
}
html[lang="en"] .nf-eyebrow{letter-spacing:.2em}
html[lang="en"] .nf-body{line-height:27px}
html[lang="en"] .nf-split .nf-h2{font-size:36px !important;line-height:1.2 !important}
html[lang="en"] .nf-term-foot{letter-spacing:.02em}
html[lang="en"] .nf-faq summary{line-height:29px}

@media (min-width:1025px){
  html[lang="en"] .nf-h1{font-size:66px !important}
}
@media (max-width:1024px) and (min-width:769px){
  html[lang="en"] .nf-h1{font-size:54px !important}
  html[lang="en"] .nf-split .nf-h2{font-size:32px !important}
}
@media (max-width:768px){
  html[lang="en"] .nf-h1{font-size:38px !important;letter-spacing:-.02em !important}
  html[lang="en"] .nf-sub{font-size:14.5px;line-height:25px}
  html[lang="en"] .nf-split .nf-h2{font-size:24px !important;line-height:1.24 !important}
  .nf-lang{padding:2px;margin:0 5px 0 0;border-radius:8px}
  .nf-lang.nf-lang-float{top:14px;right:0}
  .nf-lang button{height:22px;line-height:22px;padding:0 7px;font-size:9.5px}
}

@media (prefers-reduced-motion:reduce){
  .nf-lang{animation:none}
}

/* english nav labels are longer than the chinese ones; between the mobile
   hamburger and full desktop width they used to push the menu off-screen */
@media (min-width:768px) and (max-width:1100px){
  html[lang="en"] .ui.borderless.menu .item{
    padding:0 9px !important;
    font-size:12.5px !important;
    letter-spacing:.01em !important;
  }
  html[lang="en"] .ui.borderless.menu .item.nf-nav-brand{
    padding-left:0 !important;
    padding-right:14px !important;
  }
  html[lang="en"] .ui.borderless.menu .item.btn-link{
    margin-left:6px !important;
    padding:0 12px !important;
  }
  html[lang="en"] .ui.borderless.menu .item .icon{margin-right:3px !important}
}

/* the pill replaced One API's 78px icon dropdown, so the header needs a few
   pixels back. step it down as the viewport narrows — the inner (logged-in)
   menu carries 9–11 items and used to run past the right edge */
@media (max-width:1300px){
  .ui.borderless.menu > .ui.container > .item,
  .ui.borderless.menu .right.menu > .item{
    padding-left:9px !important;padding-right:9px !important;
  }
}
@media (max-width:1100px){
  .ui.borderless.menu > .ui.container > .item,
  .ui.borderless.menu .right.menu > .item{
    padding-left:8px !important;padding-right:8px !important;
  }
  .nf-lang{margin-left:0 !important;margin-right:4px !important}
  .nf-lang button{padding:0 7px}
}
/* below a tablet the glyphs cost more than they give — but never touch the
   hamburger: at this width it is the only way into the console */
@media (max-width:1024px){
  .ui.borderless.menu .item > .icon:first-child:not(.sidebar):not(.bars){display:none !important}
  .ui.borderless.menu .item > i.sidebar.icon,
  .ui.borderless.menu .item > i.bars.icon{
    display:inline-block !important;font-size:17px !important;margin:0 !important;
    opacity:.92 !important;color:#D6E2F0 !important;
  }
  .ui.borderless.menu a.item:has(> i.sidebar.icon),
  .ui.borderless.menu a.item:has(> i.bars.icon){padding:0 9px !important;cursor:pointer}
}
/* the sidebar already lists 价格, so the extra pill is noise on a phone */
body.nf-collapsed .ui.borderless.menu > .ui.container > a.item[data-nf-extra="price"]{display:none !important}
@media (max-width:840px){
  .ui.borderless.menu > .ui.container > .item,
  .ui.borderless.menu .right.menu > .item{
    padding-left:6px !important;padding-right:6px !important;
    font-size:11.5px !important;letter-spacing:0 !important;
  }
  .nf-lang button{font-size:9px;padding:0 6px}
}
@media (max-width:790px){
  .ui.borderless.menu > .ui.container > .item,
  .ui.borderless.menu .right.menu > .item{
    padding-left:5px !important;padding-right:5px !important;
  }
}
