/* ==========================================================================
   Troxic — legal pages (/privacy, /terms)
   Layered over troxic.css. Same tokens, same atmosphere, same chrome —
   but long-form text obeys the app's own rule and sits on an opaque
   reader surface, never on glass.
   ========================================================================== */

.legal-nav .nav-links { gap: 1.4rem; }
.legal-nav .nav-links a[aria-current="page"] { color: var(--text-1); }
.legal-nav .nav-links a[aria-current="page"]::after { transform: scaleX(1); }

.legal-head {
  padding: clamp(7.5rem, 14vw, 10rem) 0 clamp(2rem, 4vw, 3rem);
  max-width: 46rem;
}
.legal-head .overline { display: block; margin-bottom: 1rem; }
.legal-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: .9rem; }
.legal-head .meta {
  font-size: .84rem; color: var(--text-2);
  display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; align-items: center;
}
.legal-head .meta .key { height: 1.35rem; font-size: .68rem; }

/* The document itself: opaque, 65-ish characters, hairline framed. */
.doc {
  max-width: 46rem;
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 3.5vw, 3rem);
  border-radius: var(--radius-panel);
  background: var(--reader-bg);
  border: 1px solid var(--hairline);
  box-shadow: 0 30px 70px -40px var(--shade);
}
.doc > * + * { margin-top: 1rem; }
.doc p, .doc li { font-size: .945rem; line-height: 1.72; color: var(--text-1); }
.doc p { max-width: 40rem; text-wrap: pretty; }

.doc h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem; font-weight: 600; letter-spacing: -.014em;
  margin-top: 2.6rem; padding-top: 1.6rem;
  border-top: 1px solid var(--hairline);
}
.doc h2:first-of-type { margin-top: 2rem; }
.doc h3 { font-size: 1rem; font-weight: 650; margin-top: 1.7rem; }
.doc h2 + p, .doc h3 + p { margin-top: .55rem; }

.doc ul { padding-left: 1.15rem; display: grid; gap: .45rem; }
.doc li { list-style: disc; }
.doc li::marker { color: color-mix(in srgb, var(--accent) 70%, transparent); }
.doc strong { font-weight: 650; }

.doc a {
  color: var(--text-1);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-underline-offset: 3px;
  transition: color .18s var(--ease), text-decoration-color .18s var(--ease);
}
.doc a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.doc code {
  font-family: var(--font-mono); font-size: .855em;
  padding: .08em .38em; border-radius: 5px;
  background: color-mix(in srgb, var(--text-1) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--text-1) 8%, transparent);
  white-space: nowrap;
}

/* Placeholders still to be filled in before publication. */
.doc .todo {
  font-family: var(--font-mono); font-size: .82em; font-weight: 600;
  padding: .1em .45em; border-radius: 5px;
  color: #E8A75A;
  background: rgba(232, 167, 90, .14);
  border: 1px dashed rgba(232, 167, 90, .5);
  white-space: nowrap;
}

/* The source documents' callout, rebuilt as the reader's AI card. */
.doc .callout {
  position: relative;
  margin: 1.6rem 0;
  padding: 1.05rem 1.25rem;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.doc .callout::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 70%, transparent), transparent 55%, color-mix(in srgb, var(--accent) 35%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.doc .callout p { margin: 0; font-size: .92rem; }
.doc .callout p + p { margin-top: .5rem; }

/* Wide tables scroll inside their own container rather than crushing their
   columns or widening the page. The right-edge fade says there is more. */
.doc .table-wrap {
  overflow-x: auto; margin: 1.2rem 0;
  scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
          mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
}
.doc .table-wrap:not(.is-scrollable) { -webkit-mask-image: none; mask-image: none; }
.doc table { border-collapse: collapse; width: 100%; min-width: 36rem; font-size: .875rem; }
.doc .table-wrap-wide table { min-width: 52rem; }
.doc .table-wrap::-webkit-scrollbar { height: 7px; }
.doc .table-wrap::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-1) 20%, transparent);
  border-radius: 999px;
}
.doc .table-wrap::-webkit-scrollbar-track { background: transparent; }
.doc th, .doc td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.doc th {
  color: var(--text-2); font-weight: 600;
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  border-bottom-color: color-mix(in srgb, var(--text-1) 18%, transparent);
}
.doc td { color: var(--text-1); line-height: 1.55; }
.doc td:first-child { white-space: nowrap; }
.doc tr:last-child td { border-bottom: 0; }

.doc-note {
  margin-top: 1.6rem; padding: 1rem 1.2rem;
  border-radius: var(--radius-card);
  border: 1px dashed color-mix(in srgb, var(--text-1) 22%, transparent);
  font-size: .84rem; color: var(--text-2); line-height: 1.6;
  max-width: 46rem;
}
.doc-note b { color: var(--text-1); font-weight: 650; }

.legal-foot {
  max-width: 46rem;
  margin-top: 2rem;
  display: flex; flex-wrap: wrap; gap: .75rem;
}

@media (max-width: 560px) {
  .doc { border-radius: var(--radius-card); }
  .doc td:first-child { white-space: normal; }
}
