:root {
  --bg: #fffdf9;
  --surface: #f7f6fb;
  --border: #e7e5ee;
  --text: #2b2844;
  --text-muted: #6b6880;
  --text-subtle: #a19eb3;
  --accent: #6e5dd0;
  --accent-strong: #6e5dd0;
  --accent-bg: #efecfc;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
    Consolas, monospace;
  --header-height: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.container {
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 253, 249, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.8;
}

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

.btn-primary {
  background: var(--accent-strong);
  color: #fff;
}

/* Masthead: brand + last updated */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
}

.masthead-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  text-decoration: none;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding-top: 48px;
  padding-bottom: 64px;
}

/* Table of contents */
.toc-label {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

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

.toc a.is-active {
  background: var(--accent-bg);
  color: var(--accent-strong);
  font-weight: 600;
}

.toc-num,
.section-num {
  font-family: var(--font-mono);
  color: var(--accent);
}

.toc-num {
  font-size: 11px;
}

/* Mobile: collapsible contents */
.toc-mobile {
  margin-bottom: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.toc-mobile summary {
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.toc-mobile summary::-webkit-details-marker {
  display: none;
}

.toc-mobile summary .toc-label {
  display: flex;
  justify-content: space-between;
  margin: 0;
}

.toc-mobile summary .toc-label::after {
  content: "+";
}

.toc-mobile[open] summary .toc-label::after {
  content: "\2212";
}

.toc-mobile ol {
  padding: 0 6px 8px;
}

.toc-desktop {
  display: none;
}

/* Content */
.last-updated {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 31px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.hero-lead {
  margin: 0 0 24px;
  max-width: 560px;
  font-size: 15px;
  color: var(--text-muted);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}

.pill {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
}

.policy-section {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.policy-section h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.3;
}

.section-num {
  font-size: 13px;
  font-weight: 400;
}

.policy-section p,
.policy-section ul {
  margin: 0 0 16px;
}

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

.policy-section ul {
  padding-left: 20px;
}

.policy-section li {
  margin-bottom: 6px;
}

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

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

.policy-section strong {
  font-weight: 600;
}

/* Standalone email link, e.g. in "Contact us" */
.policy-section .contact-email {
  display: inline-block;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--accent);
  font-weight: 600;
  text-decoration: none;
}

/* Highlighted note, e.g. a tip at the end of a section */
.policy-section .callout {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: #ffffff;
  color: var(--text-muted);
  font-size: 14px;
}

/* Marks sections that still need content */
.policy-section .placeholder {
  padding: 12px 16px;
  border: 1px dashed var(--text-subtle);
  border-radius: 8px;
  color: var(--text-muted);
  font-style: italic;
}

/* Footer */
.site-footer {
  padding-bottom: 48px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  text-decoration: none;
  transition: color 0.15s;
}

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

/* Back to top */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(43, 40, 68, 0.08);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s, border-color 0.15s;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  border-color: var(--text-subtle);
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }

  .btn {
    padding: 8px 22px;
    font-size: 14px;
  }

  .masthead {
    padding: 48px 0 32px;
  }

  .hero h1 {
    font-size: 39px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .policy-section h2 {
    font-size: 27px;
  }

  .policy-section {
    font-size: 16px;
  }
}

@media (min-width: 1024px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 48px;
    padding-top: 80px;
  }

  .site-footer .container {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 48px;
  }

  .footer-inner {
    grid-column: 2;
  }

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

  .toc-mobile {
    display: none;
  }

  .toc-desktop {
    display: block;
    position: sticky;
    top: calc(var(--header-height) + 32px);
    align-self: start;
  }

  .content {
    max-width: 680px;
  }

  .hero h1 {
    font-size: 43px;
  }
}

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