/* Clavis Official Website — Swiss-precision developer infrastructure aesthetic
 * Zero external fonts or CDN assets. Dark-mode-first with crisp warm-stone light toggle.
 */

:root {
  color-scheme: dark;

  /* Typography */
  --font-sans:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono:
    ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'JetBrains Mono', Menlo, Consolas,
    monospace;

  /* Dark palette — Obsidian ink + Warm brass */
  --bg: #07080b;
  --bg-elev: #0c0f16;
  --bg-card: #0f131d;
  --bg-card-hover: #141926;
  --bg-code: #090c12;
  --bg-code-head: #111622;
  --bg-nav: rgba(7, 8, 11, 0.82);

  --text-strong: #f6f7fa;
  --text: #d6dbe5;
  --text-muted: #8f98aa;
  --text-subtle: #697387;

  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-brass: rgba(221, 175, 94, 0.34);

  --brass: #ddaf5e;
  --brass-bright: #f2d59b;
  --brass-soft: rgba(221, 175, 94, 0.12);
  --brass-ink: #0a0c10;

  --mint: #7bd6a4;
  --mint-soft: rgba(123, 214, 164, 0.12);
  --sky: #8ab4ff;
  --sky-soft: rgba(138, 180, 255, 0.12);
  --violet: #b69eff;
  --violet-soft: rgba(182, 158, 255, 0.12);
  --coral: #ff9494;
  --coral-soft: rgba(255, 148, 148, 0.12);

  /* Syntax highlighting */
  --syn-comment: #6e7a90;
  --syn-key: #f2d59b;
  --syn-str: #8be0b1;
  --syn-fn: #8ab4ff;
  --syn-dir: #c7b4ff;

  /* Effects */
  --shadow-card: 0 20px 50px -30px rgba(0, 0, 0, 0.85);
  --grid-line: rgba(255, 255, 255, 0.032);
  --hero-glow-1: rgba(221, 175, 94, 0.13);
  --hero-glow-2: rgba(138, 180, 255, 0.075);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Layout */
  --container: 1160px;
  --nav-h: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

:root[data-theme='light'] {
  color-scheme: light;

  --bg: #f7f6f2;
  --bg-elev: #f1efe9;
  --bg-card: #ffffff;
  --bg-card-hover: #fbfaf7;
  --bg-code: #f5f3ec;
  --bg-code-head: #ece8de;
  --bg-nav: rgba(247, 246, 242, 0.86);

  --text-strong: #11141a;
  --text: #2c3442;
  --text-muted: #566073;
  --text-subtle: #6e7789;

  --border: rgba(17, 20, 26, 0.105);
  --border-strong: rgba(17, 20, 26, 0.21);
  --border-brass: rgba(154, 101, 24, 0.34);

  --brass: #9a6518;
  --brass-bright: #7d5010;
  --brass-soft: rgba(154, 101, 24, 0.1);
  --brass-ink: #ffffff;

  --mint: #157347;
  --mint-soft: rgba(21, 115, 71, 0.1);
  --sky: #1d4ed8;
  --sky-soft: rgba(29, 78, 216, 0.09);
  --violet: #6d28d9;
  --violet-soft: rgba(109, 40, 217, 0.09);
  --coral: #b42318;
  --coral-soft: rgba(180, 35, 24, 0.09);

  --syn-comment: #6f7889;
  --syn-key: #8a5610;
  --syn-str: #146c43;
  --syn-fn: #1d4ed8;
  --syn-dir: #6d28d9;

  --shadow-card: 0 12px 32px -22px rgba(17, 20, 26, 0.16), 0 1px 2px rgba(17, 20, 26, 0.05);
  --grid-line: rgba(17, 20, 26, 0.045);
  --hero-glow-1: rgba(184, 130, 43, 0.11);
  --hero-glow-2: rgba(29, 78, 216, 0.06);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 10% -8%, var(--hero-glow-1), transparent 62%),
    radial-gradient(960px 640px at 96% -4%, var(--hero-glow-2), transparent 58%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.drawer-open {
  overflow: hidden;
}

html.theme-transitioning,
html.theme-transitioning body,
html.theme-transitioning header,
html.theme-transitioning main,
html.theme-transitioning section,
html.theme-transitioning article,
html.theme-transitioning aside,
html.theme-transitioning footer,
html.theme-transitioning a,
html.theme-transitioning button,
html.theme-transitioning pre,
html.theme-transitioning table {
  transition:
    background-color 200ms var(--ease),
    border-color 200ms var(--ease),
    color 180ms var(--ease);
}

::selection {
  background: rgba(221, 175, 94, 0.28);
  color: var(--text-strong);
}

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

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

img,
svg {
  max-width: 100%;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.copy-fallback {
  position: fixed;
  top: -9999px;
  left: -9999px;
  opacity: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--brass);
  color: var(--brass-ink);
  font-size: 14px;
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

@media (max-width: 640px) {
  .container {
    padding-inline: 18px;
  }
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  flex-shrink: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: block;
  border-radius: 7px;
  flex-shrink: 0;
}

.brand-wordmark {
  font-size: 17px;
  line-height: 1;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--brass-bright);
  background: var(--brass-soft);
  border: 1px solid var(--border-brass);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition:
    color 150ms var(--ease),
    background-color 150ms var(--ease);
}

.nav-links a:hover {
  color: var(--text-strong);
  background: rgba(128, 128, 128, 0.09);
}

.nav-links a[aria-current='page'] {
  color: var(--text-strong);
  background: var(--brass-soft);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition:
    border-color 150ms var(--ease),
    background-color 150ms var(--ease),
    color 150ms var(--ease);
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-strong);
  background: var(--bg-card-hover);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  display: block;
}

.icon-btn .theme-icon-sun {
  display: block;
}

.icon-btn .theme-icon-moon {
  display: none;
}

:root[data-theme='light'] .icon-btn .theme-icon-sun {
  display: none;
}

:root[data-theme='light'] .icon-btn .theme-icon-moon {
  display: block;
}

.nav-menu-btn {
  display: none;
}

@media (max-width: 880px) {
  .nav-links {
    display: none;
  }

  .nav-menu-btn {
    display: inline-flex;
  }
}

/* Mobile drawer */
.mobile-drawer-backdrop {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: 44;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(4px);
}

.mobile-drawer-backdrop[hidden],
.mobile-drawer[hidden] {
  display: none;
}

.mobile-drawer {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 45;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border-strong);
  padding: 16px 20px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.mobile-drawer nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-drawer a {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.mobile-drawer a:hover,
.mobile-drawer a[aria-current='page'] {
  background: var(--brass-soft);
  color: var(--text-strong);
}

.mobile-drawer-cta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 120ms var(--ease),
    background-color 150ms var(--ease),
    border-color 150ms var(--ease),
    color 150ms var(--ease),
    box-shadow 180ms var(--ease);
}

.btn:active {
  transform: scale(0.985);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--brass);
  color: var(--brass-ink);
  border-color: var(--brass);
  box-shadow: 0 8px 24px -10px rgba(221, 175, 94, 0.55);
}

.btn-primary:hover {
  background: var(--brass-bright);
  border-color: var(--brass-bright);
}

:root[data-theme='light'] .btn-primary:hover {
  background: #815310;
  border-color: #815310;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-strong);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--brass);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-strong);
  border-color: var(--border-strong);
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 76px 0 56px;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 820px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brass-bright);
  background: var(--brass-soft);
  border: 1px solid var(--border-brass);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--mint);
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.35rem, 5.4vw, 4.1rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.036em;
  color: var(--text-strong);
  text-wrap: balance;
}

.hero-subtitle {
  margin: 0 0 32px;
  max-width: 660px;
  font-size: clamp(1.05rem, 1.8vw, 1.24rem);
  line-height: 1.55;
  color: var(--text-muted);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.spec-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 820px;
}

.spec-item {
  background: var(--bg-card);
  padding: 14px 16px;
  min-width: 0;
}

.spec-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 4px;
}

.spec-value {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .hero {
    padding: 52px 0 42px;
  }

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

@media (max-width: 480px) {
  .hero-ctas .btn {
    width: 100%;
  }
}

/* Section scaffolding */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border);
}

.section-tight {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  max-width: 720px;
  margin-bottom: 36px;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass-bright);
  margin-bottom: 10px;
}

.section-header h2 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.028em;
  color: var(--text-strong);
  text-wrap: balance;
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* Architecture SVG panel */
.arch-frame {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.arch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-code-head);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.arch-bar-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-strong);
  font-weight: 600;
}

.arch-bar-badge {
  color: var(--mint);
  background: var(--mint-soft);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.arch-svg-wrap {
  padding: 20px 18px 16px;
  overflow-x: auto;
}

.arch-svg {
  width: 100%;
  min-width: 720px;
  height: auto;
  display: block;
}

/* Theme-aware SVG classes (strict CSP style-src 'self' compatible) */
.arch-boundary {
  fill: var(--bg-code);
  stroke: var(--border-brass);
  stroke-width: 1.4;
  stroke-dasharray: 6 4;
}

.arch-node {
  fill: var(--bg-card);
  stroke: var(--border-strong);
  stroke-width: 1.15;
}

.arch-node-worker {
  fill: var(--brass-soft);
  stroke: var(--brass);
  stroke-width: 1.5;
}

.arch-node-sub {
  fill: var(--bg-elev);
  stroke: var(--border);
  stroke-width: 1;
}

.arch-node-mint {
  fill: var(--mint-soft);
  stroke: var(--mint);
  stroke-width: 1.15;
}

.arch-node-sky {
  fill: var(--sky-soft);
  stroke: var(--sky);
  stroke-width: 1.15;
}

.arch-node-violet {
  fill: var(--violet-soft);
  stroke: var(--violet);
  stroke-width: 1.15;
}

.arch-title {
  fill: var(--text-strong);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 650;
}

.arch-label {
  fill: var(--brass-bright);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.arch-sub {
  fill: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.arch-line {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.4;
}

.arch-line-brass {
  fill: none;
  stroke: var(--brass);
  stroke-width: 1.6;
}

.arch-arrow {
  fill: var(--brass);
}

.arch-arrow-muted {
  fill: var(--text-muted);
}

.arch-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 13px;
  color: var(--text-muted);
}

.arch-foot strong {
  color: var(--text-strong);
  font-weight: 600;
}

/* 6 Core Capability Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 980px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  min-width: 0;
  box-shadow: var(--shadow-card);
  transition:
    border-color 180ms var(--ease),
    transform 180ms var(--ease),
    background-color 180ms var(--ease);
}

.card:hover {
  border-color: var(--border-brass);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brass-soft);
  border: 1px solid var(--border-brass);
  color: var(--brass-bright);
  flex-shrink: 0;
}

.card-icon svg {
  width: 19px;
  height: 19px;
}

.card-icon-mint {
  background: var(--mint-soft);
  border-color: rgba(123, 214, 164, 0.34);
  color: var(--mint);
}

.card-icon-sky {
  background: var(--sky-soft);
  border-color: rgba(138, 180, 255, 0.34);
  color: var(--sky);
}

.card-icon-violet {
  background: var(--violet-soft);
  border-color: rgba(182, 158, 255, 0.34);
  color: var(--violet);
}

.card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
  letter-spacing: 0.06em;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--text-strong);
}

.card p {
  margin: 0 0 16px;
  font-size: 0.925rem;
  line-height: 1.58;
  color: var(--text-muted);
  flex: 1;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Split technical showcase (AI Custody & Varlock) */
.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 28px;
  align-items: start;
}

@media (max-width: 920px) {
  .split-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-list li {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.feature-list-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 0.96rem;
  font-weight: 650;
  color: var(--text-strong);
  margin-bottom: 5px;
}

.feature-list p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.badge-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-brass {
  color: var(--brass-bright);
  background: var(--brass-soft);
}

.badge-mint {
  color: var(--mint);
  background: var(--mint-soft);
}

.badge-sky {
  color: var(--sky);
  background: var(--sky-soft);
}

.badge-coral {
  color: var(--coral);
  background: var(--coral-soft);
}

/* Code blocks with copy button */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-width: 0;
  box-shadow: var(--shadow-card);
}

.code-block + .code-block {
  margin-top: 14px;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  background: var(--bg-code-head);
  border-bottom: 1px solid var(--border);
}

.code-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    border-color 140ms var(--ease),
    background-color 140ms var(--ease),
    color 140ms var(--ease);
}

.copy-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.copy-btn[data-copied='true'] {
  border-color: var(--mint);
  background: var(--mint-soft);
  color: var(--mint);
}

.copy-btn svg {
  width: 13px;
  height: 13px;
}

.code-block pre {
  margin: 0;
  padding: 15px 16px;
  overflow-x: auto;
  font-size: 12.75px;
  line-height: 1.62;
  color: var(--text);
  tab-size: 2;
}

.tok-c {
  color: var(--syn-comment);
}

.tok-k {
  color: var(--syn-key);
}

.tok-s {
  color: var(--syn-str);
}

.tok-f {
  color: var(--syn-fn);
}

.tok-d {
  color: var(--syn-dir);
}

/* Comparison table */
.table-wrap {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow-x: auto;
  box-shadow: var(--shadow-card);
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table thead th {
  background: var(--bg-code-head);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.data-table thead th.col-clavis {
  color: var(--brass-bright);
}

.data-table td:first-child {
  font-weight: 650;
  color: var(--text-strong);
  width: 18%;
}

.data-table td {
  color: var(--text-muted);
  line-height: 1.52;
}

.data-table td.col-clavis {
  color: var(--text);
  background: rgba(221, 175, 94, 0.035);
}

:root[data-theme='light'] .data-table td.col-clavis {
  background: rgba(154, 101, 24, 0.04);
}

/* Security Invariants Strip */
.invariants-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 960px) {
  .invariants-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .invariants-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.invariant {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--brass);
  border-radius: var(--radius-md);
  padding: 20px;
  min-width: 0;
}

.invariant-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mint);
  margin-bottom: 8px;
}

.invariant h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text-strong);
}

.invariant p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* CTA Band */
.cta-band {
  background: linear-gradient(135deg, var(--brass-soft), transparent 55%), var(--bg-card);
  border: 1px solid var(--border-brass);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-card);
}

.cta-band h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: -0.025em;
  color: var(--text-strong);
}

.cta-band p {
  margin: 0;
  max-width: 560px;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.cta-band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Footer */
.site-footer {
  padding: 40px 0 48px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 140ms var(--ease);
}

.footer-links a:hover {
  color: var(--brass-bright);
}

.footer-meta {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  font-size: 12.5px;
  color: var(--text-subtle);
}

.footer-meta a {
  color: var(--text-muted);
}

.footer-meta a:hover {
  color: var(--text-strong);
}

/* Callouts */
.callout {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  margin: 20px 0;
}

.callout-warn {
  border-color: var(--border-brass);
  background: var(--brass-soft);
}

.callout-mint {
  border-color: rgba(123, 214, 164, 0.36);
  background: var(--mint-soft);
}

.callout-title {
  display: block;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-strong);
  margin-bottom: 5px;
}

.callout p {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
}

/* Tabs */
.tabs {
  margin: 18px 0;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tab-btn {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 140ms var(--ease),
    background-color 140ms var(--ease),
    color 140ms var(--ease);
}

.tab-btn:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
}

.tab-btn[aria-selected='true'] {
  color: var(--brass-bright);
  background: var(--brass-soft);
  border-color: var(--border-brass);
}

.tab-panel[hidden] {
  display: none;
}

/* Documentation portal layout */
.page-hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.12;
  color: var(--text-strong);
}

.page-hero p {
  margin: 0;
  max-width: 720px;
  font-size: 1.03rem;
  color: var(--text-muted);
}

.docs-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 40px;
  padding: 36px 0 72px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.docs-sidebar-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 0 0 10px 10px;
}

.docs-toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--border);
}

.docs-toc a {
  display: block;
  padding: 7px 12px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 13.5px;
  color: var(--text-muted);
  transition:
    color 140ms var(--ease),
    border-color 140ms var(--ease),
    background-color 140ms var(--ease);
}

.docs-toc a:hover {
  color: var(--text-strong);
}

.docs-toc a.is-active {
  color: var(--brass-bright);
  border-left-color: var(--brass);
  background: var(--brass-soft);
}

.docs-mobile-toc {
  display: none;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.docs-mobile-toc summary {
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-strong);
  cursor: pointer;
}

.docs-mobile-toc ul {
  list-style: none;
  margin: 0;
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.docs-mobile-toc a {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.docs-mobile-toc a:hover {
  background: var(--brass-soft);
  color: var(--text-strong);
}

@media (max-width: 920px) {
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .docs-sidebar {
    display: none;
  }

  .docs-mobile-toc {
    display: block;
  }
}

/* Prose typography (Docs & Privacy) */
.prose {
  min-width: 0;
}

.prose-narrow {
  max-width: 820px;
  padding: 36px 0 72px;
}

.prose section {
  scroll-margin-top: calc(var(--nav-h) + 24px);
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.prose section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.prose h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.024em;
  color: var(--text-strong);
}

.prose h3 {
  margin: 24px 0 10px;
  font-size: 1.08rem;
  font-weight: 650;
  color: var(--text-strong);
}

.prose p {
  margin: 0 0 14px;
  color: var(--text);
  line-height: 1.68;
}

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--text);
}

.prose li {
  margin-bottom: 7px;
  line-height: 1.62;
}

.prose strong {
  color: var(--text-strong);
  font-weight: 650;
}

.prose a {
  color: var(--brass-bright);
  text-decoration: underline;
  text-decoration-color: var(--border-brass);
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: var(--brass);
}

.prose :not(pre) > code {
  font-size: 0.87em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  color: var(--text-strong);
  overflow-wrap: anywhere;
}

.prose .table-wrap {
  margin: 18px 0;
}

.prose .data-table {
  min-width: 540px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-subtle);
}

/* 404 Page */
.notfound-wrap {
  min-height: calc(100vh - var(--nav-h) - 160px);
  display: flex;
  align-items: center;
  padding: 64px 0;
}

.notfound-card {
  max-width: 580px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-card);
}

.notfound-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--brass-bright);
  background: var(--brass-soft);
  border: 1px solid var(--border-brass);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.notfound-card h1 {
  margin: 0 0 12px;
  font-size: 1.9rem;
  letter-spacing: -0.028em;
  color: var(--text-strong);
}

.notfound-card p {
  margin: 0 0 24px;
  color: var(--text-muted);
}

.notfound-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
