/*
 * Shared look for the static legal pages (privacy, terms, gdpr, license).
 * Tokens mirror apps/web/src/styles.css. These pages ship without JavaScript
 * (apps/web/test/privacy-html.spec.ts forbids <script>), so theme-boot.js and the
 * in-app appearance setting are not read here: the theme follows the device.
 */

:root {
  color-scheme: dark light;
  --ink: #07090f;
  --surface: #12151f;
  --line: #242837;
  --text: #eef1f7;
  --muted: #8b93a7;
  --accent: #7aa2ff;
  --accent-hover: #a5c0ff;
  --accent-on-surface: #7aa2ff;
  --focus: #7aa2ff;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --measure: 31.5rem; /* about 70 characters of body text per line */
  --gutter: 16px;
}

@media (prefers-color-scheme: light) {
  :root {
    --ink: #ffffff;
    --surface: #f4f6fa;
    --line: #d5dbe6;
    --text: #12141a;
    --muted: #5c6578;
    --accent: #2c63d6; /* the brand accent (docs/BRAND.md): 5.44:1 on white, 5.02:1 on --surface */
    --accent-hover: #1f4fb3;
    --accent-on-surface: #2c63d6;
    --focus: #2c63d6;
  }
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  overflow-wrap: anywhere;
}

/* One centred column for header, content, and footer. */
.legal-header,
.legal-main,
.legal-footer {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Header: VanZen mark and wordmark, back to the home page. */
.legal-header {
  padding-top: 20px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1;
  border-radius: 8px;
}

.brand img {
  display: block;
  width: 30px;
  height: 30px;
}

.brand:hover {
  color: var(--text);
}

/* Content */
.legal-main {
  padding-top: 24px;
  padding-bottom: 16px;
}

h1 {
  font-size: clamp(1.75rem, 1.45rem + 1.2vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin: 0 0 12px;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 650;
  margin: 2em 0 0.5em;
}

h3 {
  font-size: 1.0625rem;
  line-height: 1.35;
  font-weight: 650;
  margin: 1.5em 0 0.4em;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

ul,
ol {
  padding-left: 1.4em;
}

li {
  margin: 0 0 0.5em;
}

/* Operator, address, and effective date: the first paragraph on every page. */
.who {
  color: var(--muted);
  margin-bottom: 28px;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-hover);
}

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

/* Highlighted block (the data-deletion steps on the privacy page). */
.card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  padding: 20px 20px 4px;
  margin: 0 0 32px;
}

.card a {
  color: var(--accent-on-surface);
}

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

.card h2 {
  margin-top: 1.4em;
}

/* Tables (none today; kept so a future table matches). */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1em;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 650;
}

/* Footer: same links on every legal page and in the app footer. */
.legal-footer {
  margin-top: 40px;
  padding-top: 20px;
  padding-bottom: 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  margin-bottom: 12px;
}

.legal-footer a {
  color: var(--muted);
}

.legal-footer a:hover,
.legal-footer a[aria-current="page"] {
  color: var(--text);
}

.legal-footer p {
  margin: 0 0 4px;
}

@media (min-width: 720px) {
  .legal-header {
    padding-top: 32px;
  }

  .legal-main {
    padding-top: 36px;
  }
}

@media print {
  :root {
    --ink: #ffffff;
    --surface: #ffffff;
    --text: #000000;
    --muted: #333333;
    --accent: #000000;
  }

  .legal-footer nav {
    display: none;
  }
}
