:root {
  --ink: #111316;
  --muted: #5d6470;
  --subtle: #8b929e;
  --line: #dfe3e8;
  --paper: #ffffff;
  --wash: #f5f7fa;
  --charcoal: #181b20;
  --blue: #1769ff;
  --blue-dark: #0e4fd1;
  --green: #108a62;
  --green-soft: #e5f6ef;
  --red: #c73333;
  --red-soft: #fde9e9;
  --amber: #b66a00;
  --radius: 8px;
  --shadow: 0 18px 60px rgba(17, 19, 22, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 clamp(20px, 5vw, 64px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  background: rgba(24, 27, 32, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #ffffff;
  background: var(--blue);
  border-radius: 7px;
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: #ffffff;
}

.hero {
  position: relative;
  min-height: 74svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 88px clamp(20px, 5vw, 64px);
  color: #ffffff;
  background: #181b20;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
}

.hero-scene {
  position: absolute;
  inset: 0;
  opacity: 0.82;
}

.scene-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 72px 72px;
}

.scene-panel {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.scene-panel-primary {
  right: 8vw;
  top: 15vh;
  width: min(520px, 42vw);
  min-height: 290px;
  padding: 28px;
}

.scene-panel-secondary {
  right: 25vw;
  bottom: 12vh;
  width: min(360px, 34vw);
  min-height: 150px;
  padding: 24px;
}

.scene-row,
.mini-line {
  height: 14px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 3px;
}

.scene-row.strong {
  width: 64%;
  background: rgba(23, 105, 255, 0.75);
}

.scene-row.short,
.mini-line.short {
  width: 44%;
}

.scene-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 52px;
}

.scene-metrics span {
  height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.scene-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  font-weight: 800;
  font-size: 0.82rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.chip-active {
  right: 32vw;
  top: 22vh;
  color: var(--green);
  background: var(--green-soft);
}

.chip-bound {
  right: 9vw;
  bottom: 24vh;
  color: #ffffff;
  background: var(--blue);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #81a9ff;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(3.8rem, 12vw, 8.6rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.hero-copy {
  max-width: 650px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
}

.button-primary {
  color: #ffffff;
  background: var(--blue);
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-secondary {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
}

.button-danger {
  color: #ffffff;
  background: var(--red);
}

.content-band {
  padding: 80px clamp(20px, 5vw, 64px);
  background: var(--paper);
}

.band-quiet {
  background: var(--wash);
}

.section-heading {
  width: min(760px, 100%);
  margin-bottom: 30px;
}

.product-grid,
.flow-grid,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.product-card,
.flow-step,
.metric-card,
.panel,
.docs-panel {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
}

.product-card,
.flow-step {
  padding: 24px;
}

.product-card p,
.flow-step p,
.docs-panel p {
  color: var(--muted);
}

.product-kicker,
.flow-number,
.helper-text {
  color: var(--subtle);
  font-size: 0.82rem;
  font-weight: 800;
}

.docs-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}

.docs-panel code {
  display: block;
  padding: 14px 16px;
  color: #ffffff;
  background: var(--charcoal);
  border-radius: 7px;
  overflow-wrap: anywhere;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100svh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  padding: 24px;
  color: #ffffff;
  background: var(--charcoal);
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 34px;
}

.side-nav a {
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.72);
  border-radius: 7px;
}

.side-nav a.active,
.side-nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-main {
  min-width: 0;
  padding: 30px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.82rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  background: var(--amber);
  border-radius: 999px;
}

.status-pill.is-online .status-dot {
  background: var(--green);
}

.summary-grid {
  margin-bottom: 18px;
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

.workspace-grid,
.data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.data-grid {
  margin-top: 18px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.panel-wide {
  grid-column: span 1;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.18rem;
}

.field,
.field-grid {
  display: grid;
  gap: 8px;
}

.field {
  margin-bottom: 14px;
}

.field span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #cfd5dd;
  border-radius: 7px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.14);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-active {
  color: var(--green);
  background: var(--green-soft);
  border-color: #bfe9d7;
}

.badge-revoked {
  color: var(--red);
  background: var(--red-soft);
  border-color: #f5c4c4;
}

.token-button {
  max-width: 100%;
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

pre {
  min-height: 300px;
  margin: 0;
  padding: 16px;
  color: #ffffff;
  background: var(--charcoal);
  border-radius: 7px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    display: flex;
    flex-wrap: wrap;
    margin-top: 18px;
  }

  .workspace-grid,
  .data-grid,
  .product-grid,
  .flow-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .scene-panel-primary {
    right: -16vw;
    width: 74vw;
  }

  .scene-panel-secondary {
    display: none;
  }
}

@media (max-width: 720px) {
  .site-header,
  .admin-topbar,
  .docs-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    min-height: 78svh;
    padding-top: 64px;
  }

  .hero-actions,
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .admin-main {
    padding: 18px;
  }
}
