/* =============================================================================
   legal.css — the legal footer, the four legal documents, and the old site's
   doors into the Open Voice Experiment (05.11.2026).

   Built on the tokens of styles.css (--ink, --bone-*, --signal, --mono …) and
   works without it: every token has a fallback, so the experiment's own pages
   (/experiment/, /app/) can load this file alone and get a readable footer
   in either a dark or a light page — text, rules and links follow the page's
   own colour where styles.css is absent.

   Sections:  1. the footer  [data-uv-footer]
              2. the doors   .xbar · .qx · .price--x   (old site only)
              3. documents   .doc                       (/privacy /terms …)
   ========================================================================== */

/* ============================================================== 1. FOOTER */

[data-uv-footer] {
  --uvf-bg: var(--ink, transparent);
  --uvf-rule: var(--line, rgba(127, 127, 127, .28));
  --uvf-rule-2: var(--line-2, rgba(127, 127, 127, .16));
  --uvf-text: var(--bone-3, currentColor);
  --uvf-strong: var(--bone-2, currentColor);
  --uvf-accent: var(--signal, currentColor);
  --uvf-mono: var(--mono, ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace);

  display: block;
  position: relative; z-index: 1;          /* above the ruled-paper hairlines */
  max-width: var(--maxw, 1380px);
  margin: 0 auto;
  padding: 2.6rem var(--gutter, 1rem) 3rem;
  border-top: 1px solid var(--uvf-rule);
  background: var(--uvf-bg);
  color: var(--uvf-text);
  font-size: .82rem;
  line-height: 1.65;
}

.uvf { display: grid; gap: 1.1rem; }
@media (min-width: 860px) {
  .uvf { grid-template-columns: 200px minmax(0, 1fr); gap: 1.4rem; }
}

.uvf__brand {
  margin: 0; display: flex; align-items: center; gap: .6rem;
  font-family: var(--uvf-mono); font-size: .78rem; font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase; color: var(--uvf-strong);
}
.uvf__glyph {
  width: 20px; height: 16px; flex: 0 0 auto;
  background:
    linear-gradient(var(--uvf-accent), var(--uvf-accent)) 0 50%/2px 6px no-repeat,
    linear-gradient(var(--uvf-accent), var(--uvf-accent)) 6px 50%/2px 14px no-repeat,
    linear-gradient(var(--uvf-accent), var(--uvf-accent)) 12px 50%/2px 16px no-repeat,
    linear-gradient(var(--uvf-accent), var(--uvf-accent)) 18px 50%/2px 9px no-repeat;
}

.uvf__body { display: grid; gap: .75rem; max-width: 82ch; min-width: 0; }
.uvf__body p { margin: 0; }
.uvf__op { color: var(--uvf-strong); overflow-wrap: anywhere; }
.uvf a {
  color: inherit;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.uvf a:hover, .uvf a:focus-visible { color: var(--uvf-accent); }
.uvf__note b { color: var(--uvf-strong); font-weight: 600; }
.uvf__help { color: var(--uvf-strong); }
.uvf__help a { white-space: nowrap; }
.uvf__meta {
  padding-top: .9rem; border-top: 1px solid var(--uvf-rule-2);
  font-family: var(--uvf-mono); font-size: .64rem; letter-spacing: .12em;
  text-transform: uppercase;
}

@media print {
  [data-uv-footer] { background: none; color: #000; border-color: #999; }
}

/* ===================================================== 2. THE DOORS (old site)
   Three plain links into /experiment/ — the bar above the masthead, the
   programme block on the landing and card five of the result screen. */

.xbar {
  position: relative; z-index: 1;
  display: block;
  padding: .6rem var(--gutter, 1rem);
  background: linear-gradient(90deg, rgba(232, 163, 61, .17), rgba(232, 163, 61, .05));
  border-bottom: 1px solid rgba(232, 163, 61, .32);
  color: var(--bone, inherit);
  font-family: var(--mono, ui-monospace, Menlo, monospace);
  font-size: .68rem; line-height: 1.5; letter-spacing: .06em;
  text-align: center; text-decoration: none;
}
.xbar b {
  margin-right: .55em;
  color: var(--signal, inherit); font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
}
.xbar__go {
  margin-left: .25em; white-space: nowrap;
  color: var(--signal, inherit);
  text-decoration: underline; text-underline-offset: 3px;
}
.xbar:hover .xbar__go, .xbar:focus-visible .xbar__go { color: var(--bone, inherit); }
.xbar:focus-visible { outline: 2px solid var(--signal, currentColor); outline-offset: -3px; }

/* card five, while the checkout is closed */
.qx { margin: .1rem 0 0; }
.qx__lead {
  margin: 0 0 1.15rem; max-width: 54ch;
  color: var(--bone-2, inherit);
  font-size: clamp(1rem, 1.7vw, 1.12rem); line-height: 1.5;
}
.qx__cta {
  padding: 1.25rem 1.2rem;
  font-size: .82rem; letter-spacing: .07em; line-height: 1.35; text-align: center;
}
.qx__note {
  margin: .95rem 0 0;
  color: var(--bone-3, inherit);
  font-family: var(--mono, ui-monospace, Menlo, monospace);
  font-size: .66rem; letter-spacing: .05em; line-height: 1.6;
}

/* the comparison choice (UV9): three options instead of two, so the toggle
   may wrap on a narrow screen rather than push the page sideways */
.toggle[data-range-group] { flex-wrap: wrap; max-width: 100%; }
.toggle[data-range-group] .toggle__btn { flex: 1 1 auto; }

/* the landing's programme block, while the checkout is closed */
.price__x {
  margin: .35rem 0 1.4rem;
  color: var(--bone-2, inherit); font-size: .95rem; line-height: 1.5;
}
.price--x .btn { line-height: 1.35; text-align: center; }

/* ======================================================= 3. LEGAL DOCUMENTS */

.doc {
  position: relative; z-index: 1;
  max-width: 46rem; margin: 0 auto;
  padding: clamp(2.2rem, 6vw, 4.5rem) var(--gutter, 1rem) clamp(3rem, 8vw, 5rem);
  color: var(--bone-2, inherit);
  font-size: clamp(.98rem, .3vw + .92rem, 1.06rem);
  line-height: 1.65;
  overflow-wrap: break-word;
}
.doc .eyebrow { color: var(--signal, inherit); margin-bottom: 1rem; }
.doc__title {
  margin: 0 0 .7rem;
  font-family: var(--serif, Georgia, serif); font-weight: 400;
  font-size: clamp(2rem, 5.4vw, 3.2rem); line-height: 1.08; letter-spacing: -.02em;
  color: var(--bone, inherit);
}
.doc__date {
  margin: 0 0 1.8rem;
  font-family: var(--mono, ui-monospace, Menlo, monospace);
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--bone-3, inherit);
}
.doc__lede { margin: 0 0 1.6rem; color: var(--bone, inherit); font-size: 1.08em; line-height: 1.55; }

.doc h2 {
  margin: 2.6rem 0 .9rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line-2, rgba(127, 127, 127, .18));
  font-family: var(--serif, Georgia, serif); font-weight: 400;
  font-size: clamp(1.35rem, 3vw, 1.8rem); line-height: 1.2; letter-spacing: -.012em;
  color: var(--bone, inherit);
  scroll-margin-top: 1rem;
}
.doc h3 {
  margin: 1.7rem 0 .55rem;
  font-family: var(--serif, Georgia, serif); font-weight: 600;
  font-size: 1.05em; color: var(--bone, inherit);
  scroll-margin-top: 1rem;
}
.doc p { margin: 0 0 1em; }
.doc ul, .doc ol { margin: 0 0 1.1em; padding-left: 1.25rem; }
.doc li { margin: 0 0 .45em; }
.doc li > ul { margin-top: .45em; }
.doc a { color: var(--signal, inherit); text-underline-offset: 3px; }
.doc strong { color: var(--bone, inherit); font-weight: 600; }
.doc code {
  font-family: var(--mono, ui-monospace, Menlo, monospace); font-size: .86em;
  color: var(--bone, inherit); overflow-wrap: anywhere;
}

/* "In short" */
.doc__short {
  margin: 0 0 2rem; padding: 1.1rem 1.25rem .4rem;
  border: 1px solid var(--line, rgba(127, 127, 127, .28));
  border-top: 2px solid var(--signal, currentColor);
  background: var(--panel, transparent);
}
.doc__short h2 {
  margin: 0 0 .7rem; padding: 0; border: 0;
  font-family: var(--mono, ui-monospace, Menlo, monospace);
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--signal, inherit);
}
.doc__short li { color: var(--bone, inherit); }

/* "On this page" */
.doc__toc { margin: 0 0 1rem; }
.doc__toc p {
  margin: 0 0 .5rem;
  font-family: var(--mono, ui-monospace, Menlo, monospace);
  font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--bone-3, inherit);
}
.doc__toc ol { columns: 2 16rem; column-gap: 2rem; margin: 0; padding-left: 1.25rem; }
.doc__toc li { margin: 0 0 .3em; break-inside: avoid; }
.doc__toc a { color: var(--bone-2, inherit); }

/* tables: three columns on a wide screen, stacked cards on a phone */
.dtable {
  width: 100%; margin: .6rem 0 1.6rem;
  border-collapse: collapse; font-size: .94em; line-height: 1.5;
}
.dtable th, .dtable td {
  padding: .75rem .9rem .75rem 0; text-align: left; vertical-align: top;
  border-top: 1px solid var(--line-2, rgba(127, 127, 127, .18));
}
.dtable th {
  font-family: var(--mono, ui-monospace, Menlo, monospace); font-weight: 400;
  font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--bone-3, inherit);
}
.dtable td:first-child { color: var(--bone, inherit); }
.dtable code { white-space: normal; }
@media (max-width: 640px) {
  .dtable thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .dtable, .dtable tbody, .dtable tr, .dtable td { display: block; width: 100%; }
  .dtable tr { padding: .7rem 0 .5rem; border-top: 1px solid var(--line, rgba(127, 127, 127, .28)); }
  .dtable td { padding: .2rem 0; border: 0; }
  .dtable td[data-label]::before {
    content: attr(data-label);
    display: block; margin-bottom: .1rem;
    font-family: var(--mono, ui-monospace, Menlo, monospace);
    font-size: .6rem; letter-spacing: .12em; text-transform: uppercase;
    color: var(--bone-3, inherit);
  }
}

/* the cookie switch */
.doc__ctl {
  margin: 1rem 0 1.4rem; padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line, rgba(127, 127, 127, .28));
  background: var(--panel, transparent);
}
.doc__status {
  margin: 0 0 .9rem;
  font-family: var(--mono, ui-monospace, Menlo, monospace);
  font-size: .72rem; letter-spacing: .06em; color: var(--bone, inherit);
}
.doc__btns { display: flex; flex-wrap: wrap; gap: .6rem; }
.doc__btns .btn { flex: 1 1 14rem; }

/* the legal pages' masthead: the four documents, the current one marked */
.doc-nav a[aria-current="page"] { color: var(--signal, inherit); }

@media print {
  .xbar, .doc__toc, .doc-nav, .doc__btns, .grain { display: none !important; }
  .doc { color: #000; max-width: none; }
  .doc a { color: #000; }
}
