:root {
  color-scheme: dark;
  --bg: #050816;
  --panel: rgba(10, 16, 32, 0.92);
  --panel-strong: rgba(8, 14, 28, 0.98);
  --border: rgba(163, 180, 208, 0.16);
  --border-strong: rgba(57, 208, 255, 0.55);
  --text: #f8fbff;
  --muted: #7d8aa3;
  --muted-strong: #b6c1d3;
  --accent: #39d0ff;
  --accent-strong: #7be36a;
  --radius: 6px;
}

* {
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(57, 208, 255, 0.1), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(123, 227, 106, 0.12), transparent 20%),
    linear-gradient(180deg, #040814 0%, #07101f 42%, #040814 100%);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

pre,
code,
.monospace {
  font-family: Inter, system-ui, sans-serif;
}

pre {
  margin: 0;
  white-space: pre-wrap;
}

.page-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.45;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.08));
}

.shell {
  width: min(1220px, calc(100% - 2rem));
  margin: 0 auto;
}

.surface,
.auth-card,
.dashboard-surface,
.sidebar,
.sidebar-panel,
.metric-card,
.telemetry-item,
.docs-block,
.stack-row,
.terminal-output,
.graph-stage,
.bar-track,
.surface-actions,
.code-block {
  min-height: 0;
  height: auto !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.logo {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #7be36a 0%, #4cd3d2 54%, #4ea5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.eyebrow--small {
  font-size: 0.72rem;
}

.auth-title,
.dashboard-title,
.card-head h2 {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.section-copy,
.sidebar-copy,
.metric-label,
.dashboard-note,
.dashboard-empty,
.telemetry-meta,
.dashboard-footer,
.auth-message,
.auth-footnote,
.stack-row span,
.bar-label,
.bar-value {
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 500;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.button:hover,
.button:focus-visible,
.sidebar-link:hover,
.sidebar-link:focus-visible {
  border-color: var(--border-strong);
  color: var(--text);
}

.button--primary {
  background: rgba(57, 208, 255, 0.08);
  border-color: rgba(57, 208, 255, 0.35);
}

.button--primary:hover,
.button--primary:focus-visible {
  background: rgba(57, 208, 255, 0.14);
  border-color: rgba(57, 208, 255, 0.6);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted-strong);
}

.button--full {
  width: 100%;
}

.page-auth {
  display: grid;
  place-items: center;
  padding: 1.5rem 0 2.5rem;
}

.auth-layout {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
}

.auth-card {
  width: min(600px, 100%);
  padding: 1.1rem;
}

.auth-head {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.auth-tabs,
.auth-actions,
.topbar-actions,
.sidebar-meta-row,
.surface-actions,
.card-head {
  display: flex;
  flex-wrap: wrap;
}

.auth-tabs {
  gap: 0.4rem;
  margin-top: 0.9rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.auth-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted-strong);
  font-weight: 500;
}

.auth-tab.is-active {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 0.85rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--muted-strong);
  font-size: 0.94rem;
  font-weight: 500;
}

.field input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #101010;
  color: var(--text);
}

.field input:focus-visible {
  outline: none;
  border-color: var(--border-strong);
}

.auth-actions {
  gap: 0.75rem;
}

.auth-message {
  margin: 0;
  font-size: 0.92rem;
}

.auth-message.is-success {
  color: var(--accent);
}

.auth-message.is-error {
  color: #f87171;
}

.auth-footnote {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
}

.page-dashboard {
  overflow-x: hidden;
}

.dashboard-app {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100vh;
  padding: 1rem;
  border-radius: 0;
  border-left: 0;
}

.sidebar-top,
.sidebar-bottom,
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-panel {
  padding: 1rem;
}

.sidebar-meta-row {
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.sidebar-nav {
  padding: 0.25rem 0;
}

.sidebar-link {
  padding: 0.8rem 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted-strong);
  font-weight: 500;
}

.sidebar-link.is-active {
  background: var(--panel-strong);
  border-color: var(--border);
  color: var(--text);
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
}

.topbar-actions,
.surface-actions {
  gap: 0.75rem;
}

.dashboard-title {
  max-width: 16ch;
  font-size: clamp(1.9rem, 3.6vw, 3.2rem);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 500;
}

.status-pill.is-live {
  color: var(--accent);
}

.main-grid,
.metric-grid,
.docs-grid {
  display: grid;
  gap: 1rem;
}

.main-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.dashboard-surface {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  grid-column: span 4;
  padding: 1rem;
}

.overview-card {
  grid-column: span 8;
}

.billing-card {
  grid-column: span 4;
}

.docs-card {
  grid-column: span 8;
}

.card-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  padding: 1rem;
}

.metric-card strong {
  display: block;
  margin-top: 0.3rem;
  color: var(--text);
  font-size: clamp(1.2rem, 2.6vw, 1.8rem);
  font-weight: 600;
  line-height: 1.1;
}

.metric-card--green strong {
  color: var(--accent);
}

.graph-stage {
  min-height: 288px;
  padding: 1rem;
  background: var(--panel-strong);
}

.graph-stage svg {
  width: 100%;
  height: 100%;
}

.chart-axis,
.chart-grid {
  stroke: #27272a;
  stroke-width: 1;
}

.chart-area {
  fill: rgba(16, 185, 129, 0.08);
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-label {
  fill: var(--muted);
  font-size: 12px;
}

.stack-list,
.bar-list,
.telemetry-stream {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stack-list {
  padding: 0;
}

.stack-row {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  background: var(--panel-strong);
}

.stack-row strong {
  color: var(--text);
  font-size: clamp(1.08rem, 2.3vw, 1.45rem);
  font-weight: 600;
}

.surface-actions {
  align-items: stretch;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.bar-track {
  width: 100%;
  min-width: 0;
  height: 10px;
  border-radius: 999px;
  background: #101010;
  overflow: hidden;
}

.bar-fill {
  display: block;
  width: var(--bar-width, 0%);
  height: 100%;
  border-radius: 999px;
  background: #1f3b32;
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem;
  background: var(--panel-strong);
}

.telemetry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.84rem;
}

.terminal-output,
.code-block {
  padding: 1rem;
  background: var(--panel-strong);
  color: var(--muted-strong);
  font-size: 0.92rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

.terminal-output {
  min-height: 288px;
  overflow: auto;
}

.docs-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.docs-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.docs-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1rem;
}

.docs-side-nav {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-self: start;
}

.docs-content-flow {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.docs-section-block {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.docs-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--panel-strong);
}

.docs-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}

.dashboard-footer {
  padding: 0.2rem 0 1rem;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 80ms;
}

.reveal-delay-2 {
  transition-delay: 160ms;
}

@media (max-width: 1180px) {
  .dashboard-app {
    grid-template-columns: 1fr;
  }

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

  .overview-card,
  .billing-card,
  .docs-card,
  .dashboard-surface {
    grid-column: span 12;
  }
}

@media (max-width: 960px) {
  .docs-grid,
  .metric-grid,
  .docs-grid--two {
    grid-template-columns: 1fr;
  }

  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-side-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100%, calc(100% - 1rem));
  }

  .dashboard-title {
    max-width: none;
  }

  .topbar {
    align-items: flex-start;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .auth-actions,
  .topbar-actions,
  .surface-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-card,
  .topbar,
  .dashboard-surface,
  .dashboard-main,
  .sidebar {
    padding: 0.95rem;
  }

  .auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
