/* Countegrity site: landing + GitBook-style docs. Light/dark via [data-theme]
   (set before paint by layouts/base.vto) and color-scheme for native UI.
   Type family is Manrope throughout (200-800, loaded in base.vto); the hero
   keeps a 200-weight display, headings sit at 700-800. */

:root {
  /* Native UI (scrollbars, form controls, light-dark()) follows the tokens.
     The bootstrap script in layouts/base.vto always sets [data-theme] before
     paint, so this light default only applies without JS. */
  color-scheme: light;
  --bg: #ffffff;
  --bg-subtle: #f7f5fc;
  --bg-tint: #fbfaff;
  --border: #e8e5f2;
  --text: #2b2a36;
  --muted: #6e6a80;
  --accent: #5300d8;
  --accent-strong: #3e00a4;
  --accent-soft: rgba(83, 0, 216, 0.08);
  --accent-softer: rgba(83, 0, 216, 0.04);
  --code-bg: #f6f8fa;
  --code-border: #ecedef;
  --hint-border: #5300d8;
  --hint-bg: #f6f2ff;
  --radius: 12px;
  --radius-sm: 8px;
  --font-sans: "Manrope", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 30px;
  --text-3xl: 38px;
  --tracking-tight: -0.03em;
  --tracking-snug: -0.015em;
  --shadow-1: 0 1px 2px rgba(24, 12, 60, 0.05), 0 6px 24px rgba(24, 12, 60, 0.06);
  --shadow-2: 0 10px 40px rgba(24, 12, 60, 0.16);
  --logo-1: #330080;
  --logo-2: #5500d4;
  --logo-3: #7f2aff;
  --logo-4: #b380ff;
  --logo-ink: #11002b;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121117;
  --bg-subtle: #18171f;
  --bg-tint: #16141d;
  --border: #292734;
  --text: #eceaf2;
  --muted: #a3a0b4;
  --accent: #9a66ff;
  --accent-strong: #b48cff;
  --accent-soft: rgba(154, 102, 255, 0.14);
  --accent-softer: rgba(154, 102, 255, 0.07);
  --code-bg: #1e2025;
  --code-border: #2b2d33;
  --hint-border: #9a66ff;
  --hint-bg: rgba(154, 102, 255, 0.1);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.25), 0 6px 24px rgba(0, 0, 0, 0.22);
  --shadow-2: 0 10px 40px rgba(0, 0, 0, 0.4);
  /* logo mark ramp, lightened so the dark end stays visible on dark bg */
  --logo-1: #9a66ff;
  --logo-2: #ad83ff;
  --logo-3: #c7a3ff;
  --logo-4: #e0ccff;
  --logo-ink: #eceaf2;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ------------------------------------------------------------------ */
/* Shared header / footer / buttons                                    */
/* ------------------------------------------------------------------ */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  min-height: 48px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--logo-ink);
}

.brand svg {
  display: block;
  height: 28px;
  width: auto;
}

.brand:hover {
  text-decoration: none;
  opacity: 0.85;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Theme mode control (partials/theme-toggle.vto): one button that cycles
   Light/Dark/System. The bootstrap script sets [data-theme-mode] on <html>
   and the label, so the icon always matches the current mode. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  padding: 5px 8px;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  display: none;
}

/* Without JS there is no [data-theme-mode]; show the system icon. */
.theme-toggle .icon-system {
  display: block;
}

[data-theme-mode="light"] .theme-toggle .icon-system,
[data-theme-mode="dark"] .theme-toggle .icon-system {
  display: none;
}

[data-theme-mode="light"] .theme-toggle .icon-light,
[data-theme-mode="dark"] .theme-toggle .icon-dark {
  display: block;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: var(--text-sm);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.site-footer p {
  margin: 0;
}

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 6px 18px var(--accent-soft);
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Landing                                                            */
/* ------------------------------------------------------------------ */

.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 72px;
  text-align: center;
}

/* Soft brand wash behind the hero, strongest at the top. */
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -12% auto;
  height: 130%;
  background: radial-gradient(
    54% 42% at 50% 0%,
    var(--accent-soft),
    var(--accent-softer) 55%,
    transparent 75%
  );
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-weight: 200;
  /* One line at every viewport: Manrope 200 renders the all-caps title at
     ~19.2em per 1em of font size, and the container leaves 100vw - 48px
     (24px padding each side, 16px slack for a visible scrollbar). Tune if
     hero.title changes. */
  font-size: clamp(12px, calc((100vw - 64px) / 21.5), 47px);
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-sub {
  max-width: 640px;
  margin: 0 auto 32px;
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.hero-note {
  max-width: 560px;
  margin: 28px auto 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

/* The Discord demo window, below the hero actions. */
.hero-demo {
  position: relative;
  z-index: 1;
  margin: 56px auto 0;
  max-width: 920px;
  text-align: left;
}

/* Logo bar under the hero: a minimal "trusted by" row. The inlined SVGs use
   currentColor, so they inherit the theme tokens: muted by default, like a
   classic grayscale logo row, and on hover they brighten toward the theme
   text color with a springy scale pop (the overshoot on the easing curve
   gives the bounce). */
.logos {
  padding: 0 0 96px;
  text-align: center;
}

.logos-label {
  margin: 0 0 20px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.logos-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px 64px;
}

/* Logo items are links; the inlined SVG is their only content, sized here. */
.logo-item {
  display: inline-block;
  height: 30px;
  color: var(--muted);
  text-decoration: none;
  transition:
    color 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-item svg {
  display: block;
  height: 30px;
  width: auto;
}

/* Size exception: the Great White North mark is a squarish map, so at 30px
   it reads far smaller than the wide wordmarks next to it. A taller item
   keeps the silhouette and its knock-out text legible. */
.logo-item--tall,
.logo-item--tall svg {
  height: 40px;
}

.logo-item:hover,
.logo-item:focus-visible {
  color: var(--text);
  transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .logo-item {
    transition: none;
  }
}

.features {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

/* Section header: title on its own line. */
.features-header {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.features-header h2 {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: var(--tracking-snug);
}

/* Comprehensive feature overview: one full-width row per merit, each with a
   title plus one-line hook on the left and a compact Discord chat demo of the
   behavior on the right, divided by hairlines. */
.feature-overview {
  margin-top: 16px;
}

.feature-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 8px 48px;
  padding: 36px 0;
  border-top: 1px solid var(--border);
}

.feature-row:last-child {
  border-bottom: 1px solid var(--border);
}

/* Icon and heading share a flex row, so the icon box centers on the heading
   line; the hook sits on its own line below. */
.feature-row-head {
  display: flex;
  align-items: center;
  gap: 20px;
}

.feature-row-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.feature-row-icon svg {
  width: 26px;
  height: 26px;
}

.feature-row-copy {
  min-width: 0;
  align-self: center;
}

.feature-row-demo {
  min-width: 0;
  align-self: center;
}

.feature-row h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.feature-row-hook {
  margin: 8px 0 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.feature-row-actions {
  margin: 14px 0 0;
}

.feature-row-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--accent);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.feature-row-play:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.feature-row-play svg {
  width: 13px;
  height: 13px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.feature {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  background: var(--bg);
  box-shadow: var(--shadow-1);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.feature:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* Collapsed feature cards sit below the demo rows, clear of the last
   row's hairline. */
.features .feature-grid {
  margin-top: 36px;
}

.enterprise {
  padding: 72px 0;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-tint), var(--bg) 70%);
}

.enterprise h2 {
  margin: 0 0 32px;
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: var(--tracking-snug);
}

.enterprise-intro {
  margin: -16px 0 32px;
  color: var(--muted);
  font-size: 17px;
}

.enterprise .feature-grid {
  margin: 0 -24px; /* let cards bleed past the tinted band edges on wide screens */
}

.enterprise-cta {
  margin: 32px 0 0;
  text-align: center;
}

.not-found {
  max-width: 720px;
  margin: 120px auto;
  padding: 0 24px;
  text-align: center;
}

.not-found h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: var(--tracking-snug);
}

/* ------------------------------------------------------------------ */
/* Docs layout (GitBook-style)                                         */
/* ------------------------------------------------------------------ */

.docs-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.docs-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 16px 16px 24px;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
}

.docs-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 12px;
}

.docs-search {
  display: block;
  margin-bottom: 16px;
}

.docs-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-sm);
}

.docs-search input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

/* Edition badge under the sidebar brand. */
.docs-edition {
  margin: 0 4px 16px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: var(--text-sm);
}

.docs-group h3 {
  margin: 0 0 6px;
  padding: 0 8px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.docs-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-group a {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
}

.docs-group a:hover {
  background: var(--accent-soft);
  text-decoration: none;
  color: var(--accent);
}

.docs-group a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.docs-sidebar-foot {
  margin: 24px 0 0;
  padding: 12px 8px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.docs-mobile-bar {
  display: none;
}

.docs-main {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 48px 96px;
}

.docs-crumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.docs-crumbs span {
  margin: 0 6px;
}

.docs-edition-banner {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--hint-bg);
  font-size: var(--text-sm);
}

.docs-edition-banner strong {
  font-weight: 700;
}

.docs-edition-banner a {
  white-space: nowrap;
  font-weight: 600;
}

.docs-article h1 {
  margin: 0 0 24px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: var(--tracking-snug);
}

/* Prose */

.docs-article > h2 {
  margin: 40px 0 12px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: var(--tracking-snug);
}

.docs-article > h2:first-of-type {
  margin-top: 24px;
}

.docs-article > h3 {
  margin: 32px 0 8px;
  font-size: 19px;
  font-weight: 700;
}

.docs-article p {
  margin: 0 0 16px;
}

.docs-article ul,
.docs-article ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.docs-article li {
  margin: 4px 0;
}

.docs-article a:hover {
  text-decoration: underline;
}

.docs-article code {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.docs-article pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
  margin: 0 0 16px;
}

.docs-article pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* Blockquotes render as GitBook-style callouts. */

.docs-article blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 3px solid var(--hint-border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--hint-bg);
}

.docs-article blockquote p {
  margin: 0;
}

.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 15px;
}

.docs-article th,
.docs-article td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.docs-article th {
  background: var(--bg-subtle);
  font-weight: 600;
}

.docs-article table code {
  white-space: nowrap;
}

/* Page footer with prev/next, GitBook-style. */

.docs-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
}

.docs-page-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.docs-page-nav:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}

.docs-page-nav-next {
  align-items: flex-end;
  text-align: right;
}

.docs-page-nav-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.docs-page-nav-title {
  font-weight: 600;
}

.docs-edit {
  margin: 24px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* Pricing                                                             */
/* ------------------------------------------------------------------ */

.pricing-hero {
  padding: 80px 0 40px;
  text-align: center;
}

.pricing-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.plan {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--bg);
  box-shadow: var(--shadow-1);
}

.plan-ee {
  border-color: var(--accent);
  box-shadow: var(--shadow-2), inset 0 2px 0 var(--accent);
  background: linear-gradient(180deg, var(--accent-softer), var(--bg) 45%);
}

.plan h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.plan-price {
  margin: 0 0 16px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
}

.plan-desc {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
}

.plan-cta {
  margin: auto 0 0;
}

.comparison {
  padding-top: 24px;
  padding-bottom: 96px;
}

.comparison h2 {
  margin: 0 0 24px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: var(--tracking-snug);
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.pricing-table th,
.pricing-table td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.pricing-table th {
  background: var(--bg-subtle);
  font-weight: 600;
}

.pricing-table .col-ee {
  background: var(--accent-softer);
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .docs-layout {
    display: block;
  }

  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
    width: 300px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.15);
  }

  .docs-menu-toggle:checked ~ .docs-sidebar {
    transform: translateX(0);
  }

  .docs-mobile-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: var(--text-sm);
  }

  .docs-main {
    padding: 24px 20px 64px;
  }

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

  .hero {
    padding: 64px 0 56px;
  }

  .hero-demo {
    margin-top: 44px;
  }

  .feature-row {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 28px 0;
  }

  .feature-row-demo {
    max-width: 560px;
  }
}