/* Edgely legal pages, served by the coming-soon nginx until the portal is deployed.
   Source of truth: edgely-devops/vps/portal/files/opt/edgely/portal/coming-soon/site/legal.css
   The HTML is generated by edgely-devops/vps/portal/tools/render_legal_page.py.

   Same tokens and brand block as coming-soon.css. The page is a document: one
   readable column, its contents beside it on wide screens and folded above it
   on narrow ones, and nothing moves. */

:root {
  --bg: #ffffff;
  --text: #171717;
  --text-body: #2e2e2e;
  --text-dim: #525252;
  --text-muted: #6b6b6b;
  --rule: #e7e7e7;
  --code-bg: #f5f5f4;
  --amber: #f59e0b;
  --amber-ink: #a34a08;
  --amber-ink-hover: #8a3e06;
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(245, 158, 11, 0.24);
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px clamp(20px, 5vw, 56px) 40px;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Brand, as on the coming-soon page ---------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 28px;
  height: 29px;
}

.brand-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ---- Title block -------------------------------------------------------- */

.doc-head {
  padding-block: clamp(40px, 8vh, 96px) clamp(28px, 4vh, 44px);
  border-bottom: 1px solid var(--rule);
}

.doc-head h1 {
  margin: 0 0 16px;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}

.doc-meta {
  margin: 0 0 24px;
  font-size: 15px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.doc-scope {
  max-width: 40rem;
  margin: 0;
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.6;
  color: var(--text-dim);
  text-wrap: pretty;
}

/* ---- Contents and text -------------------------------------------------- */

.doc {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  padding-top: clamp(32px, 5vh, 56px);
}

.toc {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding-bottom: 12px;
}

.toc-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

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

.toc a,
.toc-compact a {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-dim);
  text-decoration: none;
}

.toc a:hover,
.toc-compact a:hover {
  color: var(--amber-ink);
}

.toc .num,
.toc-compact .num {
  min-width: 1.6em;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.toc-compact {
  display: none;
}

.policy {
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-body);
}

.policy h2 {
  margin: 64px 0 16px;
  font-size: clamp(22px, 2.2vw, 26px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
  scroll-margin-top: 24px;
}

.policy h2:first-child {
  margin-top: 0;
}

.policy h3 {
  margin: 36px 0 10px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
  scroll-margin-top: 24px;
}

.policy .num {
  margin-right: 0.2em;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.policy p {
  margin: 0 0 16px;
  text-wrap: pretty;
}

.policy ul {
  margin: 0 0 20px;
  padding-left: 1.2em;
}

.policy li {
  margin: 0 0 10px;
  padding-left: 0.35em;
}

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

.policy strong {
  font-weight: 600;
  color: var(--text);
}

.policy code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--code-bg);
  font-family: var(--mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.policy a,
.foot a {
  color: var(--amber-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.policy a:hover,
.foot a:hover {
  color: var(--amber-ink-hover);
}

/* A section reached through a link, such as #account-deletion, is marked in
   the margin so the reader sees where the link landed. */
.policy :target {
  position: relative;
}

.policy :target::before {
  content: "";
  position: absolute;
  top: 0.15em;
  bottom: 0.15em;
  left: -18px;
  width: 3px;
  border-radius: 2px;
  background: var(--amber);
}

.foot {
  margin-top: clamp(56px, 10vh, 112px);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

.foot p {
  margin: 0 0 4px;
}

@media (max-width: 900px) {
  .page {
    padding-top: 20px;
  }

  .doc {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .toc {
    display: none;
  }

  .toc-compact {
    display: block;
    margin: 0 0 36px;
    padding: 0 16px;
    border: 1px solid var(--rule);
    border-radius: 10px;
  }

  .toc-compact summary {
    padding: 14px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
  }

  .toc-compact details[open] summary {
    margin-bottom: 6px;
    border-bottom: 1px solid var(--rule);
  }

  .toc-compact ol {
    padding-bottom: 12px;
  }

  .policy {
    font-size: 16px;
  }

  .policy :target::before {
    left: -12px;
  }
}

@media print {
  .top,
  .toc,
  .toc-compact {
    display: none;
  }

  .doc {
    display: block;
    padding-top: 16px;
  }

  .policy {
    max-width: none;
    font-size: 11pt;
  }

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

  .policy :target::before {
    display: none;
  }
}
