:root {
  color-scheme: dark;
  --bg: #050a0f;
  --bg-2: #07111a;
  --surface: rgba(8, 18, 27, 0.78);
  --surface-strong: rgba(10, 24, 36, 0.92);
  --surface-soft: rgba(13, 31, 45, 0.58);
  --line: rgba(129, 217, 255, 0.16);
  --line-strong: rgba(129, 217, 255, 0.32);
  --text: #edf7ff;
  --muted: #8fa9bb;
  --muted-2: #607988;
  --cyan: #23d7ff;
  --blue: #3c82ff;
  --green: #38d996;
  --amber: #f8c14a;
  --danger: #ff5e7a;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

* {
  scrollbar-color: rgba(35, 215, 255, 0.32) rgba(255, 255, 255, 0.04);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(35, 215, 255, 0.08), transparent 30%),
    linear-gradient(245deg, rgba(60, 130, 255, 0.08), transparent 34%),
    linear-gradient(180deg, var(--bg), #06131d 48%, #04080d);
  color: var(--text);
  font-feature-settings: "cv11", "ss01";
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

body::before {
  opacity: .42;
  background:
    linear-gradient(90deg, transparent 0 96%, rgba(35, 215, 255, 0.16) 96% 97%, transparent 97%),
    linear-gradient(0deg, transparent 0 96%, rgba(60, 130, 255, 0.12) 96% 97%, transparent 97%);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.92), rgba(0,0,0,.18) 74%, transparent);
  animation: route-grid 24s linear infinite;
}

body::after {
  z-index: -1;
  opacity: .34;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(35, 215, 255, .2) 12% 12.2%, transparent 12.2% 38%, rgba(60, 130, 255, .18) 38% 38.15%, transparent 38.15%),
    linear-gradient(0deg, transparent 0 22%, rgba(56, 217, 150, .12) 22% 22.2%, transparent 22.2% 66%, rgba(248, 193, 74, .12) 66% 66.2%, transparent 66.2%);
  background-size: 520px 280px;
  filter: blur(.2px);
  animation: circuit-drift 18s linear infinite;
}

h1, h2, h3, h4, h5, h6,
.btn, .tab, .input, .select, .textarea, .badge, .table {
  letter-spacing: 0 !important;
}

.glass,
.panel,
.stat,
.mockup-code,
.card,
.alert {
  border-radius: var(--radius) !important;
  border: 1px solid var(--line) !important;
  background: linear-gradient(180deg, var(--surface), rgba(6, 16, 24, .72)) !important;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.12);
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
}

.glass:hover,
.panel:hover,
.stat:hover {
  border-color: var(--line-strong) !important;
}

.rounded-xl,
.rounded-2xl,
.rounded-lg,
.rounded-md {
  border-radius: var(--radius) !important;
}

.app-shell {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid rgba(129, 217, 255, .14);
  background: rgba(5, 10, 15, .74);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(35, 215, 255, .14), rgba(60, 130, 255, .22));
  border: 1px solid rgba(129, 217, 255, .28);
  box-shadow: inset 0 0 18px rgba(35, 215, 255, .12);
}

.nav-link {
  position: relative;
  border-radius: var(--radius);
  color: var(--muted);
  transition: color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background: rgba(129, 217, 255, .08);
  transform: translateY(-1px);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: .75rem;
  right: .75rem;
  bottom: .25rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .2s var(--ease);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(5, 10, 15, .94);
  opacity: 1;
  pointer-events: auto;
  transition: opacity .18s var(--ease), visibility .18s var(--ease);
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-card {
  min-width: 220px;
  padding: 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.loader-line {
  height: 2px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .08);
}

.loader-line::before {
  content: "";
  display: block;
  height: 100%;
  width: 44%;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--blue), transparent);
  animation: loader-scan 1.05s linear infinite;
}

.btn {
  min-height: 2.45rem;
  border-radius: var(--radius) !important;
  text-transform: none;
  font-weight: 700;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  border: 0 !important;
  background: linear-gradient(135deg, var(--cyan), var(--blue)) !important;
  color: #031019 !important;
  box-shadow: 0 12px 28px rgba(35, 215, 255, .18), inset 0 1px rgba(255,255,255,.4);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 18px 40px rgba(35, 215, 255, .25), inset 0 1px rgba(255,255,255,.48);
}

.btn-outline,
.btn-ghost,
.btn:not(.btn-primary):not(.btn-error):not(.btn-success):not(.btn-accent):not(.btn-secondary) {
  border-color: rgba(129, 217, 255, .22) !important;
  color: var(--text);
  background: rgba(8, 19, 29, .52);
}

.btn-error {
  border: 0 !important;
  background: linear-gradient(135deg, #ff6a86, #e72d59) !important;
  color: #fff !important;
}

.btn-success {
  border: 0 !important;
  background: linear-gradient(135deg, #47e6a4, #16a874) !important;
  color: #03130d !important;
}

.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::after {
  content: "";
  position: absolute;
  inset: -70% -40%;
  background: linear-gradient(110deg, transparent 34%, rgba(255,255,255,.45) 50%, transparent 66%);
  transform: translateX(-130%) rotate(8deg);
  animation: button-shine 3.8s var(--ease) infinite;
}

.input,
.select,
.textarea {
  border-radius: var(--radius) !important;
  border-color: rgba(129, 217, 255, .18) !important;
  background: rgba(4, 12, 18, .72) !important;
  color: var(--text) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.03);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: 2px solid rgba(35, 215, 255, .24) !important;
  outline-offset: 1px;
  border-color: rgba(35, 215, 255, .52) !important;
}

.label-text,
.stat-title,
.stat-desc,
.opacity-70,
.opacity-75,
.opacity-80 {
  color: var(--muted);
}

.table {
  border-collapse: separate;
  border-spacing: 0 .45rem;
}

.table thead th {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  font-weight: 800;
}

.table tbody tr {
  background: rgba(8, 19, 29, .66);
  transition: transform .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}

.table tbody tr:hover {
  background: rgba(12, 31, 46, .86);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
}

.table tbody td:first-child {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}

.table tbody td:last-child {
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.badge {
  border-radius: 999px;
  border-color: rgba(129, 217, 255, .22);
  background: rgba(129, 217, 255, .08);
  color: var(--text);
  font-weight: 700;
}

.badge-warning,
.premium-badge {
  border: 0 !important;
  color: #160f02 !important;
  background: linear-gradient(90deg, var(--amber), #ffe382, var(--amber)) !important;
  box-shadow: 0 0 24px rgba(248, 193, 74, .18);
}

.tabs-boxed {
  border-radius: var(--radius);
  background: rgba(4, 12, 18, .72) !important;
  border: 1px solid rgba(129, 217, 255, .13);
}

.tab {
  border-radius: calc(var(--radius) - 2px) !important;
  color: var(--muted);
}

.tab-active {
  color: #031019 !important;
  background: linear-gradient(135deg, var(--cyan), var(--blue)) !important;
}

.page-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(35, 215, 255, .14), transparent 32%),
    linear-gradient(225deg, rgba(56, 217, 150, .1), transparent 36%),
    var(--surface);
  box-shadow: var(--shadow);
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(35,215,255,.18) 18% 18.4%, transparent 18.4% 72%, rgba(60,130,255,.14) 72% 72.3%, transparent 72.3%),
    linear-gradient(0deg, transparent 0 38%, rgba(56,217,150,.12) 38% 38.35%, transparent 38.35%);
  background-size: 420px 180px;
  opacity: .42;
  animation: circuit-drift 14s linear infinite;
}

.page-hero > * {
  position: relative;
  z-index: 1;
}

.gradient-text {
  color: var(--cyan);
  background: linear-gradient(90deg, #f2fbff, var(--cyan) 44%, var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.code-surface,
pre {
  border-radius: var(--radius) !important;
  border: 1px solid rgba(129, 217, 255, .14);
  background: rgba(2, 8, 13, .82) !important;
}

.secret-wrap,
.secret-inline {
  position: relative;
  cursor: pointer;
}

.secret-mask {
  position: absolute;
  inset: .5rem;
  display: grid;
  place-items: center;
  border-radius: calc(var(--radius) - 2px);
  background: rgba(3, 10, 15, .72);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}

.secret-inline .secret-mask {
  inset: -2px -4px;
}

.secret-wrap.revealed .secret-mask,
.secret-inline.revealed .secret-mask {
  opacity: 0;
  transform: scale(.98);
  pointer-events: none;
}

.reveal,
.motion-card {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}

.reveal.visible,
.motion-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger > * {
  opacity: 0;
  transform: translateY(14px);
  animation: panel-in .52s var(--ease) forwards;
}

.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .24s; }
.stagger > *:nth-child(6) { animation-delay: .30s; }

.model-row,
.activity-row {
  border-bottom: 1px solid rgba(129, 217, 255, .1);
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 2rem;
  padding: .35rem .65rem;
  border-radius: 999px;
  border: 1px solid rgba(129, 217, 255, .18);
  background: rgba(129, 217, 255, .07);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}

.status-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 16px rgba(56, 217, 150, .5);
}

.app-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10000;
  display: grid;
  gap: .5rem;
  max-width: min(24rem, calc(100vw - 2rem));
}

.app-toast-item {
  padding: .85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toast-in .22s var(--ease);
}

.legal {
  max-width: 72ch;
}

.legal h1 {
  font-size: 2rem;
  line-height: 1.12;
  font-weight: 850;
  margin: 0 0 .5rem;
}

.legal h2 {
  color: #f6fbff;
  font-size: 1.05rem;
  font-weight: 800;
  margin: 1.5rem 0 .55rem;
}

.legal p,
.legal li {
  color: #b8cad6;
  line-height: 1.72;
}

.legal ul,
.legal ol {
  padding-left: 1.2rem;
  margin: .5rem 0 1rem;
}

.legal ul { list-style: disc; }
.legal ol { list-style: decimal; }

.chart-box {
  height: 240px;
}

.chart-box canvas {
  height: 100% !important;
  width: 100% !important;
  display: block;
}

.mobile-nav {
  display: none;
}

@media (max-width: 780px) {
  .desktop-nav {
    display: none !important;
  }

  .mobile-nav {
    display: block;
  }

  .mobile-menu {
    display: none;
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + .45rem);
    padding: .75rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(5, 10, 15, .96);
    box-shadow: var(--shadow);
  }

  .mobile-menu.open {
    display: grid;
    gap: .45rem;
  }

  .table {
    min-width: 680px;
  }
}

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

@keyframes route-grid {
  from { background-position: 0 0, 0 0; }
  to { background-position: 72px 72px, 72px 72px; }
}

@keyframes circuit-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 520px 280px, 520px 280px; }
}

@keyframes loader-scan {
  from { transform: translateX(-100%); }
  to { transform: translateX(260%); }
}

@keyframes panel-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes button-shine {
  0%, 62% { transform: translateX(-130%) rotate(8deg); }
  100% { transform: translateX(130%) rotate(8deg); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
