/* Noire — shared styles */
:root {
  --bg: #0B0820;
  --bg-2: #110D2E;
  --surface: #1A1438;
  --surface-2: #221A47;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ECE9FF;
  --text-dim: #A8A2C9;
  --text-muted: #6E6890;
  --accent: #7C5CFF;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --accent-glow: rgba(124, 92, 255, 0.35);
  --moon: #F5C13D;
  --danger: #FF5C7A;
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 880px;
  --font-sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(245, 193, 61, 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* Stars */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}
.stars::before, .stars::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 28% 72%, #fff, transparent),
    radial-gradient(1px 1px at 44% 26%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 62% 58%, #fff, transparent),
    radial-gradient(1px 1px at 78% 14%, #fff, transparent),
    radial-gradient(1px 1px at 88% 64%, #fff, transparent),
    radial-gradient(1px 1px at 6% 88%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 36% 92%, #fff, transparent),
    radial-gradient(1px 1px at 70% 82%, #fff, transparent),
    radial-gradient(1px 1px at 96% 36%, #fff, transparent);
  opacity: 0.35;
}
.stars::after {
  background-image:
    radial-gradient(1px 1px at 18% 48%, #fff, transparent),
    radial-gradient(1px 1px at 52% 12%, #fff, transparent),
    radial-gradient(1px 1px at 84% 44%, #fff, transparent),
    radial-gradient(1px 1px at 24% 4%, #fff, transparent),
    radial-gradient(1px 1px at 66% 96%, #fff, transparent);
  opacity: 0.25;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: 0.15; }
  to { opacity: 0.4; }
}

/* Layout */
.shell {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: rgba(11, 8, 32, 0.72);
  border-bottom: 1px solid var(--border);
}
.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: block;
}
.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.header-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.header-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* Hero */
.hero {
  padding: 64px 0 32px;
  text-align: left;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(124, 92, 255, 0.25);
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
h1.title {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 20px 0 14px;
}
.hero-sub {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 620px;
  margin: 0;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-meta .dot {
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
}

/* Table of contents */
.toc {
  margin: 36px 0 48px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.toc-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 20px;
  counter-reset: toc;
}
.toc li {
  counter-increment: toc;
}
.toc a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 14px;
  padding: 6px 0;
  transition: color 0.15s;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.toc a:hover {
  color: var(--accent);
}

/* Sections */
.content {
  padding-bottom: 96px;
}
section.doc-section {
  scroll-margin-top: 90px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}
section.doc-section:first-of-type {
  border-top: none;
}
.section-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
h2.section-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  line-height: 1.2;
}
h3.sub {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 22px 0 8px;
  letter-spacing: -0.005em;
}
.doc-section p {
  margin: 0 0 14px;
  color: var(--text-dim);
}
.doc-section strong {
  color: var(--text);
  font-weight: 600;
}
.doc-section a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 92, 255, 0.4);
  transition: border-color 0.15s;
}
.doc-section a:hover {
  border-bottom-color: var(--accent);
}
.doc-section ul {
  margin: 8px 0 18px;
  padding-left: 0;
  list-style: none;
}
.doc-section ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  color: var(--text-dim);
}
.doc-section ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

/* Callout */
.callout {
  margin: 18px 0;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.08), rgba(245, 193, 61, 0.04));
  border: 1px solid rgba(124, 92, 255, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 14px;
}
.callout.warn {
  background: linear-gradient(135deg, rgba(255, 92, 122, 0.06), rgba(245, 193, 61, 0.04));
  border-color: rgba(245, 193, 61, 0.25);
}
.callout-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}
.callout.warn .callout-icon {
  background: rgba(245, 193, 61, 0.14);
  color: var(--moon);
}
.callout-body {
  flex: 1;
}
.callout-body p {
  margin: 0;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
}
.callout-body .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--moon);
  margin-bottom: 6px;
  display: block;
}

/* Tables */
.table-wrap {
  margin: 16px 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead {
  background: var(--surface-2);
}
th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  vertical-align: top;
}
tr:last-child td {
  border-bottom: none;
}
td:first-child {
  color: var(--text);
  font-weight: 500;
}

/* Info card (legal entity, contact) */
.info-card {
  margin: 14px 0 20px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.info-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 22px;
}
.info-card dt {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  align-self: center;
}
.info-card dd {
  margin: 0;
  color: var(--text);
  font-size: 14.5px;
}
.info-card dd code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 0 60px;
  margin-top: 40px;
}
.site-footer .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
}
.footer-brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}
.footer-brand small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}
.footer-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.footer-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

/* Back to top */
.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 8px 24px var(--accent-glow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
}
.back-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-top:hover {
  background: #6c4dff;
}

/* Responsive */
@media (max-width: 640px) {
  .shell { padding: 0 20px; }
  .hero { padding: 40px 0 24px; }
  h1.title { font-size: 32px; }
  .toc ol { grid-template-columns: 1fr; }
  .info-card dl { grid-template-columns: 1fr; gap: 4px 0; }
  .info-card dt { margin-top: 8px; }
  table { font-size: 13px; }
  th, td { padding: 10px 12px; }
  .header-nav a { font-size: 12.5px; padding: 6px 8px; }
  .brand-sub { display: none; }
}
