:root {
  --anchor-offset: 124px;
  --ink: #172554;
  --muted: #3b5f91;
  --line: #bfdbfe;
  --surface: #ffffff;
  --soft: #eff6ff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-deep: #1e3a8a;
  --yellow: #fde047;
  --yellow-strong: #facc15;
  --green: #16a34a;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 1px 2px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--anchor-offset);
}

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

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 10px clamp(18px, 4vw, 56px);
  background: var(--primary-deep);
  border-bottom: 1px solid rgba(191, 219, 254, 0.16);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand span {
  display: grid;
  line-height: 1.1;
}

.brand strong {
  color: #fff;
  font-size: 0.98rem;
}

.brand small {
  color: #fef3c7;
  font-size: 0.78rem;
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.site-header nav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.site-header nav a:hover {
  background: rgba(37, 99, 235, 0.85);
}

.site-header .nav-action,
.button.primary {
  background: var(--yellow);
  color: var(--ink);
}

.button.secondary,
.button.compact {
  border-color: var(--line);
  color: var(--primary-deep);
  background: #fff;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: clamp(26px, 5vw, 58px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 42px clamp(20px, 6vw, 72px);
  overflow: hidden;
  color: var(--ink);
  background: var(--soft);
}

.hero-content {
  max-width: 860px;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
}

h1 {
  max-width: 980px;
  font-size: clamp(2.35rem, 6vw, 4.8rem);
  font-weight: 900;
}

.hero-copy {
  max-width: 750px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 2.4vw, 1.3rem);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.system-preview {
  display: grid;
  grid-template-columns: minmax(205px, 0.35fr) minmax(0, 1fr);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 22px 55px rgba(30, 64, 175, 0.18);
}

.preview-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 12px;
  background: var(--primary-deep);
  color: #fff;
}

.preview-menu-title {
  padding: 0 8px 12px;
  border-bottom: 1px solid rgba(191, 219, 254, 0.22);
  color: #fff;
  font-weight: 800;
}

.preview-nav,
.preview-logout {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

.preview-nav.active {
  background: var(--yellow);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.preview-logout {
  justify-content: center;
  margin-top: auto;
  background: var(--yellow-strong);
  color: #111827;
}

.preview-workspace {
  min-width: 0;
  padding: 22px;
  background: var(--soft);
}

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

.preview-kicker {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 0.83rem;
  font-weight: 800;
}

.preview-topbar h2 {
  font-size: 1.55rem;
  color: var(--ink);
}

.preview-role {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
}

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

.preview-card,
.preview-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.preview-card {
  min-width: 0;
  padding: 18px;
}

.preview-card span {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.preview-card strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.preview-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.preview-panel {
  margin-top: 14px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header h3 {
  font-size: 1rem;
}

.panel-header span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid #dbeafe;
  color: var(--muted);
}

.panel-row:last-child {
  border-bottom: 0;
}

.panel-row b {
  color: var(--green);
  font-size: 0.82rem;
}

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

.section-heading {
  max-width: 720px;
}

.section-heading h2,
.readme-toolbar h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.02rem;
}

.summary-band,
.feature-band,
.docs-band {
  scroll-margin-top: var(--anchor-offset);
  background: var(--soft);
  border-top: 1px solid var(--line);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
}

.summary-card {
  min-height: 230px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(30, 64, 175, 0.14);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 24px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.summary-card:nth-child(2) .card-icon {
  background: var(--primary-dark);
}

.summary-card:nth-child(3) .card-icon {
  background: var(--yellow-strong);
  color: var(--ink);
}

.summary-card:nth-child(4) .card-icon {
  background: var(--green);
}

.summary-card h3 {
  color: var(--ink);
  font-size: 1.08rem;
}

.summary-card p {
  margin: 12px 0 0;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(300px, 1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-list span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--primary-deep);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.docs-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 22px;
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 84px;
}

.toc-panel,
.readme-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toc-panel {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 108px);
  overflow: auto;
  align-self: start;
  padding: 18px;
}

.toc-panel h2 {
  margin-bottom: 12px;
  font-size: 0.92rem;
  text-transform: uppercase;
}

#toc {
  display: grid;
  gap: 2px;
}

#toc a {
  display: block;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

#toc a:hover {
  background: var(--soft);
  color: var(--ink);
}

#toc a.depth-3 {
  padding-left: 20px;
  font-size: 0.84rem;
}

.readme-panel {
  min-width: 0;
  overflow: hidden;
}

.readme-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(20px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.markdown-body {
  padding: 10px clamp(20px, 4vw, 42px) 44px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  scroll-margin-top: var(--anchor-offset);
}

.markdown-body h1 {
  margin-top: 28px;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.markdown-body h2 {
  margin-top: 44px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
}

.markdown-body h3 {
  margin-top: 30px;
  font-size: 1.18rem;
}

.markdown-body p,
.markdown-body li {
  color: #354054;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.35rem;
}

.markdown-body a {
  color: var(--primary);
  font-weight: 700;
}

.markdown-body code,
.section-heading code {
  padding: 0.12em 0.35em;
  border-radius: 5px;
  background: #eff6ff;
  color: var(--ink);
  font-size: 0.92em;
}

.markdown-body pre {
  overflow: auto;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #1e3a8a;
  border-radius: 12px;
  background: #172554;
  color: #eff6ff;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
}

.site-footer a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 980px) {
  :root {
    --anchor-offset: 196px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header nav {
    justify-content: flex-start;
  }

  .summary-grid,
  .split,
  .docs-layout,
  .hero,
  .system-preview {
    grid-template-columns: 1fr;
  }

  .toc-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  :root {
    --anchor-offset: 228px;
  }

  .site-header nav a {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 0.82rem;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  .readme-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-card {
    min-height: auto;
  }

  .preview-sidebar {
    display: none;
  }

  .preview-card-grid {
    grid-template-columns: 1fr;
  }
}
