@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,700;1,9..144,300&family=DM+Sans:opsz,wght@9..40,400;9..40,500&family=DM+Mono:wght@400&display=swap');

@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-Thin.woff2') format('woff2'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-ThinItalic.woff2') format('woff2'); font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-ExtraLight.woff2') format('woff2'); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-ExtraLightItalic.woff2') format('woff2'); font-weight: 200; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-LightItalic.woff2') format('woff2'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-Italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-MediumItalic.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-SemiBoldItalic.woff2') format('woff2'); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-BoldItalic.woff2') format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-ExtraBold.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-ExtraBoldItalic.woff2') format('woff2'); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-Black.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-4/web/InterDisplay-BlackItalic.woff2') format('woff2'); font-weight: 900; font-style: italic; font-display: swap; }

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

:root {
  --sidebar-w: 280px;
  --bg: #FCFCFC;
  --sidebar-bg: #031225;
  --sidebar-hover: #062041;
  --sidebar-active: #062041;
  --sidebar-text: #C9C9C9;
  --sidebar-text-dim: #888;
  --sidebar-accent: #5EB5AA;
  --border: rgba(255,255,255,.07);
  --content-text: #031225;
  --content-text2: #062041;
  --content-text3: #888;
  --content-border: rgba(0,0,0,.4);
  --content-bg2: #FCFCFC;
}

html { 
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}
body { 
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--content-text);
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

/* ── MOBILE HEADER ─────────────────────────────────────────────────────────── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--sidebar-bg);
  z-index: 200;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}
.hamburger {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; padding: 4px;
}
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--sidebar-text); border-radius: 2px;
  transition: all .2s;
}
.mobile-title {
  font-family: 'Fraunces', serif;
  font-size: 15px; font-weight: 700;
  color: #fff; letter-spacing: -.01em;
}

/* ── OVERLAY ───────────────────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 149;
}
.sidebar-overlay.active { display: block; }

/* ── SIDEBAR ───────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 150;
  overflow: hidden;
}

.sidebar-header {
  padding: 22px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-brand {
  font-family: 'Fraunces', serif;
  font-size: 16px; font-weight: 700;
  color: #fff; text-decoration: none;
  letter-spacing: -.01em;
  display: block; margin-bottom: 3px;
}
.sidebar-brand:hover { color: var(--sidebar-accent); }
.sidebar-brand-img img { height: 20px; }
.sidebar-tagline {
  font-size: 11px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--sidebar-text-dim);
}

.sidebar-search {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-search input {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  padding: 7px 11px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--sidebar-text);
  outline: none;
}
.sidebar-search input::placeholder { color: var(--sidebar-text-dim); }
.sidebar-search input:focus { border-color: rgba(29,158,117,.4); }

.sidebar-docs {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.sidebar-docs::-webkit-scrollbar { width: 4px; }
.sidebar-docs::-webkit-scrollbar-track { background: transparent; }
.sidebar-docs::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.sidebar-doc { margin: 1px 0; }

.sidebar-doc-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px 9px 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--sidebar-text);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.35;
  border-radius: 6px;
  margin: 0 4px;
  width: calc(100% - 8px);
  transition: background .12s, color .12s;
}
.sidebar-doc-btn:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-doc.active .sidebar-doc-btn {
  background: rgba(29,158,117,.15);
  color: var(--sidebar-accent);
}
.sidebar-doc-num {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: var(--sidebar-text-dim);
  flex-shrink: 0;
  width: 20px;
}
.sidebar-doc.active .sidebar-doc-num { color: var(--sidebar-accent); opacity: .7; }
.sidebar-doc-title { flex: 1; font-weight: 500; }
.sidebar-doc-arrow {
  font-size: 14px;
  color: var(--sidebar-text-dim);
  transition: transform .2s;
  flex-shrink: 0;
}
.sidebar-doc.active .sidebar-doc-arrow { transform: rotate(90deg); color: var(--sidebar-accent); }

/* Outline */
.doc-outline {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s cubic-bezier(.4,0,.2,1);
  padding: 0 0 0 0;
}
.sidebar-doc.active .doc-outline {
  max-height: 9999px;
}

.outline-item {
  display: block;
  padding: 5px 14px 5px 44px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--sidebar-text-dim);
  text-decoration: none;
  cursor: pointer;
  transition: color .1s, background .1s;
  border-radius: 4px;
  margin: 0 4px;
}
.outline-item:hover { color: var(--sidebar-text); background: rgba(29,158,117,.15); }
.outline-item.active-anchor { color: var(--sidebar-accent); }
.outline-h3 { padding-left: 56px; font-size: 11px; opacity: .8; }
.outline-h3:hover { opacity: 1; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex; gap: 14px;
  flex-shrink: 0;
}
.sidebar-footer-link {
  font-size: 11px;
  color: var(--sidebar-text-dim);
  text-decoration: none;
}
.sidebar-footer-link:hover { color: var(--sidebar-text); }

/* ── CONTENT ───────────────────────────────────────────────────────────────── */
.content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  flex: 1;
}
.content-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 48px 80px;
}

/* Doc sections */
.doc-section {
  display: none;
  padding-top: 48px;
}
.doc-section.active { display: block; }

.doc-header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--content-border);
  margin-bottom: 40px;
}
.doc-title {
  font-family: 'Fraunces', serif;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -.022em;
  line-height: 1.1;
  margin-bottom: 10px;
}
.doc-subtitle {
  font-size: 14px;
  color: var(--content-text3);
  line-height: 1.55;
}

/* Policy content typography */
.doc-body { font-size: 15px; line-height: 1.8; color: var(--content-text2); }
.doc-body h2 {
  font-family: 'Fraunces', serif;
  font-size: 22px; font-weight: 700;
  color: var(--content-text);
  margin: 44px 0 14px;
  line-height: 1.3;
  padding-top: 4px;
}
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 {
  font-family: 'Fraunces', serif;
  font-size: 16px; font-weight: 700;
  color: var(--content-text);
  margin: 28px 0 10px;
  line-height: 1.4;
}
.doc-body h4 {
  font-size: 14px; font-weight: 500;
  color: var(--content-text);
  margin: 20px 0 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 11px;
}
.doc-body p { margin: 0 0 16px; }
.doc-body ul, .doc-body ol {
  margin: 0 0 16px 22px;
}
.doc-body li { margin-bottom: 6px; line-height: 1.7; }
.doc-body a { color: #1d9e75; }
.doc-body strong { font-weight: 600; color: var(--content-text); }
.doc-body em { font-style: italic; }
.doc-body blockquote {
  border-left: 2px solid rgba(0,0,0,.12);
  padding-left: 16px;
  margin: 20px 0;
  color: var(--content-text3);
}
.doc-body code {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  background: var(--content-bg2);
  padding: 2px 5px;
  border-radius: 3px;
}
.doc-body hr {
  border: none;
  border-top: 1px solid var(--content-border);
  margin: 36px 0;
}

/* Inline notice callouts */
.doc-body p:has(> strong:first-child:last-child),
.doc-body p > strong:only-child {
  font-style: normal;
}

/* ── SCROLL PROGRESS ───────────────────────────────────────────────────────── */
.progress-bar {
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  height: 2px;
  background: var(--sidebar-accent);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 100;
  transition: transform .05s linear;
}

/* ── RESPONSIVE ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .content-inner { padding: 0 32px 60px; }
}

@media (max-width: 700px) {
  :root { --sidebar-w: 0px; }
  
  .mobile-header { display: flex; }
  
  body { padding-top: 52px; }
  
  .sidebar {
    width: 280px;
    padding-top: 52px;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    top: 0;
  }
  .sidebar.open { transform: translateX(0); }
  
  .content { margin-left: 0; }
  .content-inner { padding: 0 20px 48px; }
  
  .doc-title { font-size: 28px; }
  .doc-section { padding-top: 32px; }
  
  .progress-bar { left: 0; }
}

@media (max-width: 400px) {
  .doc-title { font-size: 24px; }
  .content-inner { padding: 0 16px 40px; }
}

/* ── SEARCH HIGHLIGHT ──────────────────────────────────────────────────────── */
.sidebar-doc.search-hidden { display: none; }
