:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5f6672;
  --border: #e3e6ea;
  --accent: #1a73e8;
  --accent-soft: #e8f0fe;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #171b21;
    --text: #e8eaed;
    --muted: #9aa0a6;
    --border: #2a3038;
    --accent: #8ab4f8;
    --accent-soft: #1c2a40;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-underline-offset: 2px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand .domain { color: var(--muted); font-weight: 500; }

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

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
}

.site-nav a:hover { color: var(--text); background: var(--accent-soft); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* Legal document layout */
.doc-layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 16px 64px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
}

.toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 112px); overflow-y: auto; }
.toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  padding: 5px 10px;
  border-left: 2px solid var(--border);
}
.toc a:hover { color: var(--text); border-left-color: var(--accent); }

.doc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 48px;
  min-width: 0;
}

.doc h1 { font-size: 34px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 8px; }
.doc .meta { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.doc h2 { font-size: 21px; line-height: 1.3; letter-spacing: -0.01em; margin: 40px 0 12px; padding-top: 4px; }
.doc h3 { font-size: 17px; margin: 24px 0 8px; }
.doc p, .doc ul, .doc ol { margin: 0 0 14px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 0 0 6px; }
.doc strong { font-weight: 650; }

.callout {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 0 0 28px;
}
.callout h2 { margin: 0 0 8px; font-size: 16px; }
.callout ul { margin: 0; }

.table-wrap { overflow-x: auto; margin: 0 0 16px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.doc th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }

.caps { text-transform: uppercase; font-size: 14px; letter-spacing: 0.01em; }

address { font-style: normal; margin: 0 0 14px; }

/* Landing */
.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 72px 16px 56px;
  text-align: center;
}
.hero img { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 8px 24px rgba(26, 115, 232, 0.25); }
.hero h1 { font-size: 40px; letter-spacing: -0.02em; margin: 20px 0 8px; }
.hero p { color: var(--muted); font-size: 18px; margin: 0 auto 28px; max-width: 520px; }

.cards {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 72px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  text-decoration: none;
}
.card:hover { border-color: var(--accent); }
.card strong { display: block; font-size: 16px; margin-bottom: 4px; }
.card span { color: var(--muted); font-size: 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); }
.site-footer .inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}
.site-footer a { color: var(--muted); }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 24px; }
  .toc { position: static; max-height: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
  .doc { padding: 28px 20px; }
  .doc h1 { font-size: 28px; }
  .brand .domain { display: none; }
}

@media print {
  .site-header, .toc, .site-footer { display: none; }
  .doc-layout { display: block; padding: 0; }
  .doc { border: 0; padding: 0; }
  body { background: #fff; color: #000; }
}
