:root {
  --bg: #0f0f23;
  --bg-end: #16213e;
  --text: #f8fafc;
  --muted: #a6b0c3;
  --dim: #68768d;
  --surface: rgba(22, 33, 62, 0.62);
  --surface-strong: rgba(22, 33, 62, 0.86);
  --line: rgba(165, 180, 252, 0.18);
  --line-strong: rgba(165, 180, 252, 0.32);
  --accent: #5b7dff;
  --accent-strong: #8aa1ff;
  --accent-hover: #7a95ff;
  --accent-soft: rgba(91, 125, 255, 0.16);
  --green: #7ee787;
  --amber: #fbbf24;
  --danger: #ff7b8a;
  --danger-bg: rgba(255, 90, 110, 0.12);
  --danger-line: rgba(255, 90, 110, 0.35);
  --success: #7ee787;
  --success-bg: rgba(80, 220, 120, 0.12);
  --success-line: rgba(80, 220, 120, 0.35);
  --input-bg: rgba(255, 255, 255, 0.06);
  --input-bg-focus: rgba(255, 255, 255, 0.09);
  --grid-line: rgba(255, 255, 255, 0.035);
  --nav-bg: rgba(15, 15, 35, 0.82);
  --hover-bg: rgba(255, 255, 255, 0.05);
  --button-bg: rgba(255, 255, 255, 0.055);
  --panel-bg: rgba(22, 33, 62, 0.72);
  --card-bg: rgba(22, 33, 62, 0.62);
  --subtle-bg: rgba(255, 255, 255, 0.045);
  --band-bg: rgba(22, 33, 62, 0.56);
  --trace-bg: rgba(10, 15, 32, 0.76);
  --pill-bg: rgba(91, 125, 255, 0.10);
  --pill-border: rgba(165, 180, 252, 0.22);
  --cta-bg: linear-gradient(135deg, rgba(91, 125, 255, 0.16), rgba(126, 231, 135, 0.06)), rgba(22, 33, 62, 0.78);
  --page-gradient: linear-gradient(135deg, rgba(26, 26, 46, 0.96), rgba(22, 33, 62, 0.96));
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

html[data-theme="light"] {
  --bg: #edf3fb;
  --bg-end: #f7faff;
  --text: #111827;
  --muted: #536176;
  --dim: #738195;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(91, 125, 255, 0.18);
  --line-strong: rgba(91, 125, 255, 0.32);
  --accent: #5b7dff;
  --accent-strong: #3f63f3;
  --accent-hover: #3f63f3;
  --accent-soft: rgba(91, 125, 255, 0.12);
  --green: #15803d;
  --amber: #b45309;
  --danger: #b4233a;
  --danger-bg: rgba(180, 35, 58, 0.1);
  --danger-line: rgba(180, 35, 58, 0.28);
  --success: #15803d;
  --success-bg: rgba(21, 128, 61, 0.1);
  --success-line: rgba(21, 128, 61, 0.28);
  --input-bg: rgba(255, 255, 255, 0.76);
  --input-bg-focus: #ffffff;
  --grid-line: rgba(26, 35, 55, 0.055);
  --nav-bg: rgba(246, 249, 254, 0.86);
  --hover-bg: rgba(30, 41, 59, 0.055);
  --button-bg: rgba(255, 255, 255, 0.78);
  --panel-bg: rgba(255, 255, 255, 0.82);
  --card-bg: rgba(255, 255, 255, 0.86);
  --subtle-bg: rgba(255, 255, 255, 0.72);
  --band-bg: #e9f1f8;
  --trace-bg: #ffffff;
  --pill-bg: rgba(255, 255, 255, 0.84);
  --pill-border: rgba(91, 125, 255, 0.20);
  --cta-bg: linear-gradient(135deg, rgba(91, 125, 255, 0.14), rgba(21, 128, 61, 0.07)), rgba(255, 255, 255, 0.92);
  --page-gradient: linear-gradient(135deg, rgba(227, 235, 248, 0.98), rgba(247, 250, 255, 0.98));
  --shadow: 0 24px 80px rgba(30, 41, 59, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  background: var(--page-gradient), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

body.rb-mesh::before,
body.landing-page::before,
body.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 34rem);
}

a {
  color: inherit;
}

.shell,
.rb-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.navbar,
.landing-page header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
}

.nav,
.navbar-content {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand,
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
}

.brand:hover,
.navbar-logo:hover {
  opacity: 0.86;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(165, 180, 252, 0.42);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 22px rgba(91, 125, 255, 0.10);
}

.brand-mark::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
  box-shadow: 0 0 0 5px rgba(91, 125, 255, 0.10);
}

.nav-actions,
.navbar-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link,
.lang-switch,
.button,
.rb-button {
  min-height: 42px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.94rem;
  white-space: nowrap;
}

.nav-link,
.lang-switch {
  color: var(--muted);
  border: 1px solid transparent;
  width: auto;
  margin: 0;
  padding: 0 12px;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.nav-link:hover,
.lang-switch:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--hover-bg);
}

.scheme-switch {
  min-height: 34px;
  display: inline-grid;
  grid-template-columns: repeat(3, 28px);
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--button-bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

.scheme-switch button {
  width: 28px;
  height: 28px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.scheme-switch button:hover {
  color: var(--text);
  background: var(--hover-bg);
  transform: none;
  box-shadow: none;
}

.scheme-switch button.active {
  color: var(--text);
  background: var(--line-strong);
}

.button,
.rb-button {
  border: 1px solid var(--line-strong);
  padding: 0 18px;
  background: var(--button-bg);
}

.button.primary,
.rb-button.primary {
  color: #f8fbff;
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 34px rgba(91, 125, 255, 0.26);
}

.button.secondary,
.rb-button.secondary {
  color: var(--text);
}

.button:hover,
.rb-button:hover {
  transform: translateY(-1px);
}

.glass-card,
.rb-card {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

@media (max-width: 640px) {
  .shell,
  .rb-shell {
    width: min(100% - 24px, 1180px);
  }

  .nav,
  .navbar-content {
    min-height: 64px;
    gap: 6px;
  }

  .brand,
  .navbar-logo {
    gap: 8px;
    font-size: 0.96rem;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .nav-actions,
  .navbar-links {
    gap: 6px;
  }

  .lang-switch {
    min-width: 38px;
    padding: 0 6px;
    line-height: 1.05;
  }

  .scheme-switch {
    grid-template-columns: repeat(3, 22px);
    min-height: 30px;
    padding: 3px;
  }

  .scheme-switch button {
    width: 22px;
    height: 24px;
  }

  .nav-link.docs {
    display: none;
  }
}

/* Landing page */
body.landing-page {
    margin: 0;
}

body.landing-page .page {
    position: relative;
    z-index: 1;
}

body.landing-page .shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

body.landing-page header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--nav-bg);
    backdrop-filter: blur(18px);
}

body.landing-page .nav {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

body.landing-page .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.02em;
}

body.landing-page .brand-mark {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(103, 232, 249, 0.45);
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: rgba(103, 232, 249, 0.08);
    box-shadow: inset 0 0 22px rgba(103, 232, 249, 0.08);
}

body.landing-page .brand-mark::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 4px;
    box-shadow: 0 0 0 5px rgba(103, 232, 249, 0.08);
}

body.landing-page .nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

body.landing-page .nav-link,
body.landing-page .lang-switch,
body.landing-page .button {
    min-height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.94rem;
    white-space: nowrap;
}

body.landing-page .nav-link,
body.landing-page .lang-switch {
    color: var(--muted);
    border: 1px solid transparent;
    padding: 0 12px;
    background: transparent;
}

body.landing-page .nav-link:hover,
body.landing-page .lang-switch:hover {
    color: var(--text);
    border-color: var(--line);
    background: var(--hover-bg);
}

body.landing-page .lang-switch {
    cursor: pointer;
}

body.landing-page .scheme-switch {
    min-height: 34px;
    display: inline-grid;
    grid-template-columns: repeat(3, 28px);
    align-items: center;
    padding: 3px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--button-bg);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

body.landing-page .scheme-switch button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
}

body.landing-page .scheme-switch button:hover {
    color: var(--text);
    background: var(--hover-bg);
}

body.landing-page .scheme-switch button.active {
    color: var(--text);
    background: var(--line-strong);
}

body.landing-page .hero {
    min-height: calc(88vh - 72px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
    gap: 48px;
    align-items: center;
    padding: 64px 0 36px;
}

body.landing-page .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.landing-page .eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 20px rgba(134, 239, 172, 0.9);
}

body.landing-page h1 {
    margin: 0;
    max-width: 820px;
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    line-height: 0.96;
    letter-spacing: -0.065em;
}

body.landing-page .hero-copy {
    max-width: 720px;
    margin: 26px 0 0;
    color: var(--muted);
    font-size: clamp(1.08rem, 1.6vw, 1.28rem);
}

body.landing-page .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

body.landing-page .proof {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

body.landing-page .proof span {
    border: 1px solid var(--pill-border);
    border-radius: 999px;
    padding: 7px 12px;
    color: var(--muted);
    background: var(--pill-bg);
    font-size: 0.86rem;
    font-weight: 650;
}

body.landing-page .runtime-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-bg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

body.landing-page .panel-top {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    color: var(--dim);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.landing-page .panel-dots {
    display: flex;
    gap: 6px;
}

body.landing-page .panel-dots span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--line-strong);
}

body.landing-page .runtime-flow {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.landing-page .flow-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: var(--subtle-bg);
}

body.landing-page .flow-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.98rem;
}

body.landing-page .flow-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

body.landing-page .arrow {
    width: 1px;
    height: 30px;
    background: var(--line-strong);
    margin: 0 auto;
    position: relative;
}

body.landing-page .arrow::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 8px;
    height: 8px;
    border-top: 1px solid var(--line-strong);
    border-right: 1px solid var(--line-strong);
    transform: translateX(-50%) rotate(135deg);
}

body.landing-page .blocked {
    border-color: rgba(251, 113, 133, 0.34);
}

body.landing-page .blocked strong {
    color: var(--danger);
}

body.landing-page .allowed {
    border-color: rgba(134, 239, 172, 0.32);
}

body.landing-page .allowed strong {
    color: var(--green);
}

body.landing-page .proxy {
    border-color: rgba(103, 232, 249, 0.36);
    background: rgba(103, 232, 249, 0.06);
}

body.landing-page .proxy strong {
    color: var(--accent);
}

body.landing-page section {
    padding: 84px 0;
}

body.landing-page .section-head {
    max-width: 760px;
    margin-bottom: 34px;
}

body.landing-page .section-head.center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

body.landing-page h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.03;
    letter-spacing: -0.045em;
}

body.landing-page .section-head p {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 1.08rem;
}

body.landing-page .grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

body.landing-page .card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
    background: var(--card-bg);
}

body.landing-page .card .label {
    display: inline-flex;
    margin-bottom: 18px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

body.landing-page .card h3 {
    margin: 0 0 10px;
    font-size: 1.22rem;
    line-height: 1.25;
}

body.landing-page .card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.98rem;
}

body.landing-page .wide-band {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--band-bg);
}

body.landing-page .split {
    display: grid;
    grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
    gap: 42px;
    align-items: start;
}

body.landing-page .list {
    display: grid;
    gap: 12px;
}

body.landing-page .list-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: var(--subtle-bg);
}

body.landing-page .list-item strong {
    display: block;
    margin-bottom: 4px;
}

body.landing-page .list-item span {
    color: var(--muted);
}

body.landing-page .trace-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--trace-bg);
    overflow: hidden;
}

body.landing-page .trace-line {
    display: grid;
    grid-template-columns: 110px 1fr 82px;
    gap: 14px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.84rem;
}

body.landing-page .trace-line:last-child {
    border-bottom: 0;
}

body.landing-page .trace-line strong {
    color: var(--text);
    font-weight: 700;
}

body.landing-page .trace-ok {
    color: var(--green);
}

body.landing-page .trace-warn {
    color: var(--amber);
}

body.landing-page .final-cta {
    padding: 86px 0 94px;
}

body.landing-page .cta-box {
    border: 1px solid rgba(103, 232, 249, 0.28);
    border-radius: 8px;
    padding: 38px;
    background: var(--cta-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

body.landing-page .cta-box h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

body.landing-page .cta-box p {
    margin: 12px 0 0;
    color: var(--muted);
    max-width: 680px;
}

body.landing-page footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 28px 0;
    color: var(--dim);
}

body.landing-page .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

body.landing-page .footer-links {
    display: flex;
    gap: 18px;
}

body.landing-page .footer-links a {
    color: var(--muted);
    text-decoration: none;
}

body.landing-page .footer-links a:hover {
    color: var(--text);
}

@media (max-width: 940px) {
    body.landing-page .hero,
    body.landing-page .split {
        grid-template-columns: 1fr;
    }

    body.landing-page .hero {
        padding-top: 58px;
    }

    body.landing-page .runtime-panel {
        max-width: 680px;
    }

    body.landing-page .grid {
        grid-template-columns: 1fr;
    }

    body.landing-page .cta-box {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    body.landing-page .shell {
        width: min(100% - 24px, 1180px);
    }

    body.landing-page .nav {
        min-height: 64px;
        gap: 6px;
    }

    body.landing-page .brand {
        gap: 8px;
        font-size: 0.96rem;
    }

    body.landing-page .brand-mark {
        width: 30px;
        height: 30px;
    }

    body.landing-page .nav-actions {
        gap: 6px;
    }

    body.landing-page .lang-switch {
        min-width: 38px;
        padding: 0 6px;
        line-height: 1.05;
    }

    body.landing-page .scheme-switch {
        grid-template-columns: repeat(3, 22px);
        min-height: 30px;
        padding: 3px;
    }

    body.landing-page .scheme-switch button {
        width: 22px;
        height: 24px;
    }

    body.landing-page .nav-actions > .button.primary {
        display: none;
    }

    body.landing-page .nav-link.docs {
        display: none;
    }

    body.landing-page .hero {
        min-height: auto;
        padding: 48px 0 52px;
    }

    body.landing-page h1 {
        font-size: clamp(2.1rem, 12vw, 3.3rem);
    }

    body.landing-page .hero-actions .button,
    body.landing-page .cta-box .button {
        width: 100%;
    }

    body.landing-page .trace-line {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    body.landing-page section {
        padding: 58px 0;
    }
}
