:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-strong: #ffffff;
  --text: #111827;
  --muted: #5b6472;
  --subtle: #e5e7eb;
  --border: #dbe3ee;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --accent-strong: #1d4ed8;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 28px rgba(15, 23, 42, 0.07);
  --radius: 8px;
  --content-width: 900px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1120;
    --surface: #111827;
    --surface-strong: #172033;
    --text: #f8fafc;
    --muted: #b6c1d1;
    --subtle: #263244;
    --border: #2e3b4f;
    --accent: #60a5fa;
    --accent-soft: rgba(37, 99, 235, 0.18);
    --accent-strong: #93c5fd;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.24);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --surface: #111827;
  --surface-strong: #172033;
  --text: #f8fafc;
  --muted: #b6c1d1;
  --subtle: #263244;
  --border: #2e3b4f;
  --accent: #60a5fa;
  --accent-soft: rgba(37, 99, 235, 0.18);
  --accent-strong: #93c5fd;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.07), transparent 440px),
    linear-gradient(180deg, var(--surface), var(--bg) 42%);
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

button,
select,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: 3px;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: 0;
  height: 4px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.42);
}

.hero {
  padding: 24px clamp(20px, 4vw, 56px) 72px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.theme-toggle__icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset -5px -3px 0 rgba(255, 255, 255, 0.75);
}

.hero__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: var(--shadow-soft);
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
  line-height: 1.18;
}

h1 {
  font-size: clamp(2.55rem, 5vw, 4.8rem);
  font-weight: 800;
}

.hero__updated {
  margin: 18px 0 0;
  color: var(--accent-strong);
  font-size: 1.02rem;
  font-weight: 700;
}

.hero__description {
  max-width: 720px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.7;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, var(--content-width));
  gap: 32px;
  align-items: start;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.toc-wrap {
  position: sticky;
  top: 24px;
  align-self: start;
}

.toc-card {
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .toc-card,
:root:not([data-theme="light"]) .toc-card {
  background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
}

.toc-title {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.toc ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.toc a.toc-depth-3 {
  margin-left: 10px;
  padding-top: 7px;
  padding-bottom: 7px;
  color: color-mix(in srgb, var(--muted) 88%, var(--accent));
  font-size: 0.82rem;
  font-weight: 600;
}

.toc a:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
  transform: translateX(2px);
}

.toc a.is-active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

.mobile-toc {
  display: none;
}

.policy-content {
  display: grid;
  gap: 24px;
  max-width: var(--content-width);
}

.policy-section {
  position: relative;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  scroll-margin-top: 92px;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.policy-section:target,
.policy-section.is-targeted {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow);
}

.policy-section:hover {
  transform: translateY(-2px);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: clamp(1.45rem, 2.5vw, 2.1rem);
}

.policy-section h3 {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--subtle);
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 800;
}

.policy-section p {
  margin: 0 0 16px;
  color: var(--muted);
}

.policy-section p:last-child {
  margin-bottom: 0;
}

.policy-section strong {
  color: var(--text);
}

.policy-section ul,
.policy-section ol {
  margin: 10px 0 22px;
  padding-left: 1.35rem;
  color: var(--muted);
}

.policy-section li {
  margin: 6px 0;
  padding-left: 0.18rem;
}

.policy-section li::marker {
  color: var(--accent);
}

.copy-link {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-strong);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.copy-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.copy-link.is-copied {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.contact-section {
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 58%),
    var(--surface-strong);
}

.contact-section a {
  font-weight: 800;
}

pre,
code {
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
}

code {
  padding: 0.15em 0.35em;
}

pre {
  overflow: auto;
  padding: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  background: var(--surface);
  color: var(--text);
}

.fade-section {
  opacity: 0;
  transform: translateY(14px);
}

.fade-section.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 520ms ease, transform 520ms ease;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 54px auto 0;
  padding: 34px 0 42px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .hero {
    padding-bottom: 44px;
  }

  .topbar {
    margin-bottom: 48px;
  }

  .page-shell {
    display: block;
    width: min(100% - 32px, var(--content-width));
  }

  .toc-wrap {
    display: none;
  }

  .mobile-toc {
    position: sticky;
    top: 12px;
    z-index: 9;
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
  }

  .mobile-toc label {
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .mobile-toc select {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--text);
    font: inherit;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15.5px;
  }

  .hero {
    padding: 18px 16px 36px;
  }

  .topbar {
    align-items: flex-start;
    margin-bottom: 36px;
  }

  .brand {
    max-width: 240px;
    font-size: 0.95rem;
  }

  .theme-toggle__text {
    display: none;
  }

  .theme-toggle {
    width: 40px;
    justify-content: center;
    padding: 0;
  }

  .hero__description {
    font-size: 1rem;
  }

  .section-heading {
    display: grid;
    gap: 12px;
  }

  .copy-link {
    justify-self: start;
  }

  .policy-section {
    padding: 24px 20px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --text: #111827;
    --muted: #1f2937;
    --border: #cbd5e1;
    --shadow: none;
    --shadow-soft: none;
  }

  body::before,
  .scroll-progress,
  .topbar,
  .toc-wrap,
  .mobile-toc,
  .copy-link,
  .back-to-top {
    display: none !important;
  }

  .hero {
    padding: 0 0 24px;
  }

  .page-shell,
  .site-footer {
    display: block;
    width: 100%;
    margin: 0;
  }

  .policy-content {
    display: block;
    max-width: none;
  }

  .policy-section {
    break-inside: avoid;
    margin: 0 0 18px;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

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