:root {
  --bg: #05020b;
  --panel: rgba(17, 10, 35, 0.74);
  --panel-strong: rgba(14, 10, 27, 0.92);
  --text: #f8f4ff;
  --muted: #b9accf;
  --line: rgba(207, 173, 255, 0.18);
  --purple: #8f39ff;
  --purple-2: #c35cff;
  --magenta: #ff4fd8;
  --cyan: #46d7ff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 24% 0%, rgba(143, 57, 255, 0.22), transparent 28rem),
    radial-gradient(circle at 85% 16%, rgba(70, 215, 255, 0.12), transparent 24rem),
    linear-gradient(180deg, #05020b, #070412 50%, #030106);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.88), transparent 82%);
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}


.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 18rem;
  height: 18rem;
  pointer-events: none;
  background: radial-gradient(circle, rgba(195, 92, 255, 0.18), transparent 68%);
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 180ms ease;
}

.site-shell {
  position: relative;
  isolation: isolate;
}

.topbar {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 20;
  width: min(1180px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 3, 16, 0.58);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px);
  transform: translateX(-50%);
  transition: border-color 260ms ease, background 260ms ease, box-shadow 260ms ease;
}

.topbar.is-scrolled {
  border-color: rgba(195, 92, 255, 0.34);
  background: rgba(7, 3, 16, 0.82);
  box-shadow: 0 18px 70px rgba(105, 42, 204, 0.28);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.nav-links a {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 18px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.nav-links .nav-cta {
  color: #fff;
  background: linear-gradient(135deg, rgba(143, 57, 255, 0.95), rgba(255, 79, 216, 0.82));
  box-shadow: 0 0 30px rgba(195, 92, 255, 0.24);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
  transition: transform 180ms ease;
}

.rules-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
  padding-top: 104px;
  overflow-x: hidden;
}

.rules-sidebar {
  position: sticky;
  top: 104px;
  height: calc(100vh - 104px);
  padding: 46px 20px;
  overflow-x: hidden;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(14, 10, 27, 0.94), rgba(5, 2, 11, 0.9)),
    radial-gradient(circle at 20% 15%, rgba(143, 57, 255, 0.18), transparent 18rem);
  overflow-y: auto;
}

.sidebar-title,
.eyebrow {
  color: var(--purple-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rules-toc {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.toc-link {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  padding-right: 28px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.toc-link::after {
  position: absolute;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  content: "";
  background: rgba(185, 172, 207, 0.64);
}

.toc-link:hover,
.toc-link.is-active {
  border-color: rgba(195, 92, 255, 0.52);
  background: rgba(143, 57, 255, 0.18);
  color: #fff;
  transform: translateX(3px);
}

.toc-link.is-active::after {
  background: var(--purple-2);
  box-shadow: 0 0 18px rgba(195, 92, 255, 0.78);
}

.toc-icon,
.section-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(195, 92, 255, 0.28);
  border-radius: 8px;
  background: rgba(143, 57, 255, 0.16);
  color: var(--purple-2);
}

.toc-link strong,
.toc-link small {
  display: block;
}

.toc-link small {
  margin-top: 3px;
  font-size: 0.82rem;
}

.rules-content {
  padding: 0 clamp(18px, 4vw, 48px) 80px;
}

.rules-hero {
  min-height: 260px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.44fr);
  gap: 24px;
  align-items: start;
  padding: 46px 0;
  background:
    linear-gradient(90deg, rgba(5, 2, 11, 0.92), rgba(5, 2, 11, 0.48), rgba(5, 2, 11, 0.2)),
    url("assets/latency-3-hero.png") center right / cover no-repeat;
  border-bottom: 1px solid var(--line);
}

.rules-hero h1 {
  max-width: 760px;
  margin: 12px 0 14px;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 0.98;
}

.rules-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.rules-search {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 2, 11, 0.72);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.rules-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.rules-search input {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: 0;
}

.rules-search kbd {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.72rem;
}

.rule-section {
  scroll-margin-top: 86px;
  margin-top: 28px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.24);
}


.section-heading {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0 0 4px;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.rule-item {
  border: 1px solid rgba(207, 173, 255, 0.12);
  border-radius: 8px;
  background: rgba(5, 2, 11, 0.42);
  overflow: hidden;
}

.rule-item + .rule-item {
  margin-top: 10px;
}

.rule-item summary,
.rule-item:not(details) {
  display: grid;
  grid-template-columns: 66px 1fr 36px;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.rule-item summary::-webkit-details-marker {
  display: none;
}

.rule-number {
  display: grid;
  min-width: 44px;
  min-height: 38px;
  place-items: center;
  border-radius: 8px;
  background: rgba(143, 57, 255, 0.18);
  color: var(--purple-2);
  font-weight: 900;
}

.rule-main strong,
.rule-main p {
  display: block;
}

.rule-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.rule-chevron {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.rule-chevron::before {
  display: block;
  width: 9px;
  height: 9px;
  margin: 8px auto 0;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  content: "";
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.rule-item[open] .rule-chevron::before {
  margin-top: 11px;
  transform: rotate(225deg);
}

.rule-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 22px 0 100px;
  color: var(--muted);
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 260ms ease, opacity 220ms ease, transform 220ms ease, padding 220ms ease;
}

.rule-item[open] .rule-body {
  padding-bottom: 20px;
  opacity: 1;
  transform: translateY(0);
}

.rule-body p,
.rule-body ul {
  margin: 0 0 14px;
}

.rule-body strong,
.rule-body h2,
.rule-body h3,
.rule-body h4 {
  color: #fff;
}

.rule-body code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(143, 57, 255, 0.18);
  color: #fff;
}

.rule-body a {
  color: var(--cyan);
  font-weight: 800;
}

.empty-state {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .rules-shell {
    grid-template-columns: 1fr;
  }

  .rules-sidebar {
    position: relative;
    top: 0;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rules-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {

  .toc-link::after {
    display: none;
  }

  .rule-item summary,
  .rule-item:not(details) {
    grid-template-columns: 1fr 34px;
  }

  .rule-number {
    width: fit-content;
  }

  .rule-body {
    padding-right: 18px;
    padding-left: 18px;
  }

  .rule-item[open] .rule-body {
    padding-bottom: 18px;
  }

}

@media (max-width: 920px) {
  .topbar {
    border-radius: 24px;
    justify-content: flex-end;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    display: grid;
    width: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(7, 3, 16, 0.94);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .nav-links a {
    flex: none;
  }

  .topbar.nav-open .nav-links {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .topbar.nav-open .nav-toggle span:first-child {
    transform: translateY(3.5px) rotate(45deg);
  }

  .topbar.nav-open .nav-toggle span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
  }
}









