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

:root {
  --purple: #9B7AE8;
  --purple-light: #EDE9FE;
  --purple-dark: #6D4FC2;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-600: #4B5563;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --white: #ffffff;
  --radius: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-800);
  background: var(--gray-50);
  min-height: 100vh;
}

a { color: var(--purple-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
}

.logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--purple);
  letter-spacing: -0.3px;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  transition: all 0.15s;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--purple-light);
  color: var(--purple);
  text-decoration: none;
}

.nav-link.active {
  background: var(--purple);
  color: var(--white);
}

/* ── Home page ── */
.home-main {
  max-width: 600px;
  margin: 80px auto;
  padding: 0 24px;
  text-align: center;
}

.home-main h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.subtitle {
  font-size: 14px;
  color: var(--gray-400);
  margin-bottom: 48px;
}

.doc-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
}

.doc-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
  text-align: left;
}

.doc-card:hover {
  border-color: var(--purple);
  box-shadow: 0 4px 20px rgba(155, 122, 232, 0.12);
  text-decoration: none;
  transform: translateY(-1px);
}

.doc-card-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.doc-card-body h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.doc-card-body p {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
}

.doc-card-arrow {
  margin-left: auto;
  font-size: 20px;
  color: var(--gray-400);
  flex-shrink: 0;
}

.contact {
  font-size: 14px;
  color: var(--gray-400);
}

/* ── Document pages ── */
.doc-main {
  padding: 40px 24px 80px;
}

.doc-container {
  max-width: 760px;
  margin: 0 auto;
}

.doc-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 2px solid var(--purple-light);
}

.doc-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--purple-light);
  color: var(--purple);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.doc-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.doc-meta {
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.doc-note {
  font-size: 13px;
  color: var(--purple);
  font-style: italic;
}

/* ── Table of Contents ── */
.toc {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 40px;
}

.toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-400);
  margin-bottom: 12px;
}

.toc ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc li {
  font-size: 13px;
}

.toc a {
  color: var(--gray-600);
}

.toc a:hover {
  color: var(--purple);
}

/* ── Sections ── */
section {
  margin-bottom: 48px;
  scroll-margin-top: 72px;
}

section h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--purple-light);
}

section p {
  margin-bottom: 12px;
  color: var(--gray-800);
}

section ul, section ol {
  padding-left: 24px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

section li {
  color: var(--gray-800);
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--white);
}

thead {
  background: var(--purple-light);
}

th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--purple-dark);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-top: 1px solid var(--gray-100);
  vertical-align: top;
  color: var(--gray-800);
  line-height: 1.5;
}

tr:hover td {
  background: var(--gray-50);
}

/* ── Contact block ── */
.contact-block {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-block p {
  margin-bottom: 0;
  font-size: 14px;
}

/* ── Doc end ── */
.doc-end {
  text-align: center;
  color: var(--gray-400);
  font-style: italic;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

/* ── Footer ── */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--gray-400);
}

.site-footer a {
  color: var(--gray-400);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .site-header { padding: 0 16px; }
  .doc-main { padding: 24px 16px 60px; }
  .home-main { margin: 40px auto; }
  .home-main h1 { font-size: 26px; }
  .doc-header h1 { font-size: 22px; }
  .doc-card { padding: 18px; gap: 14px; }
  th, td { padding: 8px 10px; }
  .contact-block { padding: 16px; }
  .nav-link { padding: 5px 10px; font-size: 12px; }
}
