/* ==========================================================================
   Alkando — legal documents (privacy policy, terms).

   Modelled on structured.app's Notion-hosted policy: one narrow reading
   column, a large title, a meta line, an info callout, plain section
   headings, and a slim table of contents on the right edge that opens on
   hover. The typography below is ready for the final text; until then the
   page shows only the callout.
   ========================================================================== */

/* Flat, not the brand gradient. A long legal text is read, not looked at,
   and the benchmark keeps its page a single quiet surface; the colour is
   still the app's own screen background (ThemeTokens.alkandoBrand.bg). */
html[data-page="privacy"] body,
html[data-page="terms"] body,
html[data-page="suggestions"] body {
  background: var(--ak-bg);
}

/* The only chrome on a document page: a small way back, where the
   benchmark puts its breadcrumb. */
.doc__back {
  position: fixed;
  top: 18px;
  left: 20px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px 8px 8px;
  border-radius: 999px;
  color: var(--ak-text-3);
  font: 600 13.5px/1 var(--ak-font-ui);
  text-decoration: none;
  transition:
    color var(--ak-dur-tap) ease,
    background-color var(--ak-dur-tap) ease;
}

.doc__back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) and (pointer: fine) {
  .doc__back:hover {
    color: var(--ak-text);
    background: rgba(255, 255, 255, 0.07);
  }
}

.doc__back:focus-visible {
  outline: 2px solid var(--ak-accent);
  outline-offset: 2px;
}

.doc {
  width: 100%;
  /* 720px of text, the same measure as the benchmark. */
  max-width: 768px;
  margin: 0 auto;
  padding: 128px 24px 120px;
  font-family: var(--ak-font-ui);
}

.doc__title {
  margin: 0;
  /* The UI face, not the rounded display one: at this length the rounded
     cut reads as a marketing headline rather than a document title. */
  font: 700 clamp(1.9rem, 4vw, 2.5rem)/1.2 var(--ak-font-ui);
  letter-spacing: -0.015em;
}

.doc__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 22px 0 0;
  color: var(--ak-text-2);
  /* Same size as the body: it is a line of the document, not a caption. */
  font: 400 16px/1.5 var(--ak-font-ui);
}

.doc__meta b {
  color: var(--ak-text);
  font-weight: 600;
}

/* The Notion callout, in the app's accent. */
.doc__callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 28px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  /* Quiet and small-cornered, like the benchmark's callout: it is an aside
     inside the text, not a panel laid over it. */
  border-radius: 8px;
  background: color-mix(in srgb, var(--ak-accent) 9%, rgba(255, 255, 255, 0.04));
  color: var(--ak-text);
  font: 400 16px/1.5 var(--ak-font-ui);
}

.doc__callout svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  stroke: var(--ak-accent);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

.doc__callout p {
  margin: 0;
}

/* --- the document itself --- */

.doc__body {
  margin-top: 36px;
  /* Full strength, 16/24 — the benchmark does not dim its body text, and
     dimmed grey over a long document is what makes it tiring to read. */
  color: var(--ak-text);
  font: 400 16px/1.5 var(--ak-font-ui);
}

.doc__body:empty {
  display: none;
}

.doc__body h2 {
  margin: 36px 0 10px;
  color: var(--ak-text);
  font: 700 20px/1.35 var(--ak-font-ui);
  letter-spacing: -0.005em;
  scroll-margin-top: 90px;
}

.doc__body h3 {
  margin: 26px 0 8px;
  color: var(--ak-text);
  font: 600 17px/1.35 var(--ak-font-ui);
}

.doc__body p {
  margin: 0 0 16px;
}

.doc__body ul,
.doc__body ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.doc__body li + li {
  margin-top: 6px;
}

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

.doc__body a {
  color: var(--ak-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- contents, right edge ---
   Notion's pattern: a column of short dashes, one per section, that opens
   into a labelled list when the pointer reaches it. The dash of the section
   on screen is highlighted. */

.doc__toc {
  position: fixed;
  top: 50%;
  right: 48px;
  z-index: 10;
  transform: translateY(-50%);
}

.doc__toc ol {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: var(--ak-radius-tile);
  list-style: none;
  transition:
    background-color var(--ak-dur-sheet) var(--ak-ease-out),
    border-color var(--ak-dur-sheet) var(--ak-ease-out);
}

.doc__toc a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--ak-text-3);
  font: 500 13.5px/1.2 var(--ak-font-ui);
  text-decoration: none;
}

.doc__toc a::after {
  content: "";
  flex-shrink: 0;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.6;
}

.doc__toc a[aria-current="true"] {
  color: var(--ak-accent);
}

.doc__toc a[aria-current="true"]::after {
  width: 22px;
  opacity: 1;
}

.doc__toc a span {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition:
    max-width var(--ak-dur-sheet) var(--ak-ease-out),
    opacity var(--ak-dur-tap) ease;
}

.doc__toc:hover ol,
.doc__toc:focus-within ol {
  border-color: var(--ak-glass-stroke);
  background: var(--ak-glass-fill);
  backdrop-filter: var(--ak-glass-blur);
  -webkit-backdrop-filter: var(--ak-glass-blur);
}

.doc__toc:hover a span,
.doc__toc:focus-within a span {
  max-width: 260px;
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .doc__toc a:hover {
    color: var(--ak-text);
  }
}

/* Below this the column and the dashes would collide. */
@media (max-width: 1100px) {
  .doc__toc {
    display: none;
  }
}

@media (max-width: 520px) {
  .doc {
    padding-top: 104px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .doc__toc ol,
  .doc__toc a span {
    transition: none;
  }
}

.doc__note {
  margin: 18px 0 0;
  color: var(--ak-text-3);
  font: 400 14.5px/1.5 var(--ak-font-ui);
}

/* Unfilled placeholders in a draft document: impossible to miss, so none
   reaches a published page by accident. */
.doc__todo {
  padding: 1px 6px;
  border-radius: 6px;
  background: #ffd66e;
  color: #2a1330;
  font-weight: 600;
}
