/* BestNexus. Dark, tool-like. System fonts only. */

:root {
  --bg: #0f1113;
  --bg-2: #131518;
  --panel: #16181c;
  --panel-2: #1b1e23;
  --line: #262a31;
  --line-2: #333842;
  --text: #e8eaee;
  --muted: #a2a8b0;
  --muted-2: #767d88;
  --red: #ff5050;
  --red-soft: #ff7a72;
  --red-faint: #ff9d94;
  --amber: #ffb454;
  --green: #45d483;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
}

*, *:before, *:after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 15px/1.65 var(--sans);
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::selection { background: rgba(255, 80, 80, .35); color: #fff; }
a { color: var(--red-soft); text-decoration: none; }
a:hover { color: #fff; }
code {
  font-family: var(--mono);
  font-size: .88em;
  background: #1c1f25;
  border: 1px solid #272b32;
  border-radius: 4px;
  padding: 1px 5px;
  color: #ffc4bd;
  word-break: break-all;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* ---------- header (static, scrolls with the page) ---------- */
.sitehead {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 17, 19, .92);
}
.headrow {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 0 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.brand img { width: 34px; height: 34px; border-radius: 8px; display: block; }
.brandtxt { display: block; line-height: 1.15; }
.b1 { display: block; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.b2 {
  display: block; font-size: 10px; font-weight: 600;
  color: var(--muted-2); letter-spacing: .1em; text-transform: uppercase; margin-top: 2px;
}
.sitenav { margin-left: auto; width: fit-content; }
.navrow-main { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.navrow-main a {
  position: relative;
  display: inline-block;
  padding: 6px 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
}
.navrow-main a::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 1px;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .18s ease;
  border-radius: 2px;
}
.navrow-main a:hover { color: var(--text); }
.navrow-main a:hover::after { transform: scaleX(1); }
.navrow-main a.on { color: var(--red-soft); }
.navrow-main a.on::after { transform: scaleX(1); }
.navrow-sub {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}
.sublabel {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.navrow-sub a { font-size: 12.5px; color: var(--muted-2); transition: color .15s; }
.navrow-sub a:hover { color: var(--text); }
.navrow-sub a.on { color: var(--red-soft); }

.navtoggle {
  display: none;
  position: relative;
  width: 42px; height: 38px;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  cursor: pointer;
}
.navtoggle::before, .navtoggle::after, .navtoggle .nt-bar {
  content: "";
  position: absolute;
  left: 50%;
  width: 16px; height: 2px;
  margin-left: -8px;
  background: #cfd3da;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.navtoggle::before { top: 12px; }
.navtoggle .nt-bar { top: 18px; }
.navtoggle::after { top: 24px; }
body.nav-open .navtoggle .nt-bar { opacity: 0; }
body.nav-open .navtoggle::before { transform: translateY(6px) rotate(45deg); }
body.nav-open .navtoggle::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- main ---------- */
main.wrap { padding-top: 4px; padding-bottom: 30px; min-height: 60vh; }
.trail {
  font-size: 12.5px;
  color: var(--muted-2);
  margin: 16px 0 2px;
}
.trail a { color: var(--muted-2); }
.trail a:hover { color: var(--text); }
.trail .sep { opacity: .45; margin: 0 2px; }
.trail .here { color: var(--muted); }

.intro { padding-top: 24px; }
h1 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.02em;
  font-weight: 700;
  margin: 0 0 10px;
}
.lede {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 760px;
  margin: 0 0 18px;
}
section { padding: 28px 0 4px; }
section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 12px;
}
section h2::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--red);
  transform: rotate(45deg);
  border-radius: 1px;
  flex-shrink: 0;
}
section h3 { font-size: 15.5px; font-weight: 700; margin: 20px 0 6px; }
section p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 12px;
  max-width: 780px;
}
section p b, section p strong { color: var(--text); }
section ul, section ol {
  color: var(--muted);
  margin: 0 0 14px;
  padding-left: 22px;
  max-width: 780px;
}
section li { margin: 7px 0; line-height: 1.65; }
section ol li::marker { color: var(--red); font-weight: 600; }
section ul li::marker { color: var(--muted-2); }

/* ---------- mirror panel ---------- */
.mirrorpanel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 18px 0 10px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
}
.mp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.mp-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red-soft);
}
.mp-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 80, 80, .16);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(255, 80, 80, .16); }
  50% { opacity: .55; box-shadow: 0 0 0 6px rgba(255, 80, 80, .05); }
}
.mp-note { font-size: 12px; color: var(--muted-2); }
.mlist {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: grid;
  gap: 8px;
}
.mrow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #101216;
  border: 1px solid #23262d;
  border-radius: 9px;
  padding: 10px 12px;
  transition: border-color .16s ease, background .16s ease;
  animation: rise .5s cubic-bezier(.2, .7, .3, 1) both;
}
.mlist .mrow:nth-child(2) { animation-delay: .08s; }
.mlist .mrow:nth-child(3) { animation-delay: .16s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.mrow:hover { border-color: rgba(255, 80, 80, .5); background: #12151a; }
.mrow.flash { animation: rowflash .9s ease; }
@keyframes rowflash {
  0% { background: rgba(255, 80, 80, .14); }
  100% { background: #101216; }
}
.maddr {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--red-faint);
  word-break: break-all;
  background: none;
  border: 0;
  padding: 0;
  user-select: all;
}
.copybtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font: 600 12px var(--sans);
  letter-spacing: .02em;
  color: var(--muted);
  background: #171a20;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 7px 12px;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s, transform .16s;
}
.copybtn:hover {
  color: #fff;
  border-color: var(--red);
  background: #1e2127;
  transform: translateY(-1px);
}
.copybtn:active { transform: translateY(0); }
.copybtn .ico { display: block; }
.copybtn .ico-check { display: none; }
.copybtn.ok {
  color: var(--green);
  border-color: rgba(69, 212, 131, .55);
  background: rgba(69, 212, 131, .07);
}
.copybtn.ok .ico-copy { display: none; }
.copybtn.ok .ico-check { display: block; }
.mirrorpanel[data-compact="1"] .mrow { padding: 8px 10px; }
.mirrorpanel[data-compact="1"] .maddr { font-size: 12px; }
.mirrorpanel[data-compact="1"] .mp-note { display: none; }

/* ---------- cards ---------- */
.cardgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 30px 0 6px;
}
.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  color: var(--text);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 80, 80, .5);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}
.card-k {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red-soft);
}
.card h3 { font-size: 15.5px; margin: 9px 0 6px; }
.card p { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 0; max-width: none; }

/* ---------- callout ---------- */
.callout {
  background: rgba(255, 80, 80, .055);
  border: 1px solid rgba(255, 80, 80, .22);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 26px 0 10px;
  max-width: 780px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}
.callout b { color: var(--red-faint); }

/* ---------- faq ---------- */
.faq { display: grid; gap: 10px; max-width: 840px; }
.faq details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 13px 18px;
  transition: border-color .18s ease;
}
.faq details[open] { border-color: rgba(255, 80, 80, .5); }
.faq summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "";
  width: 7px; height: 7px;
  flex-shrink: 0;
  border-right: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::before { transform: rotate(225deg); }
.faq details p {
  margin: 11px 0 2px 21px;
  font-size: 14px;
  line-height: 1.68;
  color: var(--muted);
  max-width: none;
}

/* ---------- glossary terms ---------- */
.terms { max-width: 840px; margin: 0; }
.terms dt {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-top: 20px;
}
.terms dt:first-child { margin-top: 4px; }
.terms dd {
  margin: 4px 0 0;
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--muted);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: #16161a;
  font: 700 13px var(--sans);
  letter-spacing: .02em;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--red);
  transition: background .16s, transform .16s, border-color .16s, color .16s;
}
.btn:hover { background: var(--red-soft); border-color: var(--red-soft); color: #16161a; transform: translateY(-1px); }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-2);
}
.btn.ghost:hover { border-color: var(--red); color: var(--red-soft); background: transparent; }

/* ---------- 404 ---------- */
.four .errnum {
  font-family: var(--mono);
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .06em;
  color: rgba(255, 80, 80, .22);
  margin: 18px 0 8px;
}
.four .btn + .btn { margin-left: 10px; }

/* ---------- footer ---------- */
.sitefoot {
  margin-top: 52px;
  background: #0b0d0f;
  border-top: 1px solid var(--line);
  padding-top: 32px;
  padding-bottom: 18px;
}
.footgrid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 8px;
}
.footbrand .brand img { width: 26px; height: 26px; border-radius: 6px; }
.footbrand .b1 { font-size: 14px; }
.footbrand p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted-2);
  margin: 12px 0 0;
  max-width: 320px;
}
.footlabel {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}
.footcol a { display: block; font-size: 13px; color: var(--muted); margin: 7px 0; }
.footcol a:hover { color: var(--red-soft); }
.footbase {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted-2);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cardgrid { grid-template-columns: 1fr; }
  .footgrid { grid-template-columns: 1fr 1fr; }
  .footbrand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .navtoggle { display: block; }
  .sitenav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    width: auto;
    background: #101216;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 34px rgba(0, 0, 0, .45);
    padding: 6px 0 14px;
    opacity: 0;
    transition: opacity .18s ease;
    z-index: 40;
  }
  body.nav-open .sitenav { display: block; opacity: 1; }
  .navrow-main { flex-direction: column; align-items: stretch; gap: 0; }
  .navrow-main a {
    padding: 11px 20px;
    font-size: 15px;
    border-bottom: 1px solid #1b1e24;
  }
  .navrow-main a::after { display: none; }
  .navrow-main a.on { background: rgba(255, 80, 80, .07); }
  .navrow-sub {
    justify-content: flex-start;
    gap: 14px;
    padding: 12px 20px 0;
    border-top: none;
  }
  .sublabel { margin-right: 2px; }
  h1 { font-size: 25px; }
  .lede { font-size: 15px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 15px; }
  .headrow { padding: 12px 0 10px; }
  .brand img { width: 30px; height: 30px; }
  .b1 { font-size: 15px; }
  .mp-head { padding: 10px 12px; }
  .mrow { flex-wrap: wrap; }
  .maddr { font-size: 11.5px; width: 100%; }
  .copybtn { width: 100%; justify-content: center; padding: 9px; }
  section h2 { font-size: 18px; }
  .four .errnum { font-size: 54px; }
  .four .btn { display: inline-flex; width: auto; }
  .footgrid { grid-template-columns: 1fr; gap: 20px; }
  .footbase { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}
