/* Meridian legal pages — self-contained, no external fonts or CDNs.
   Colours mirror the vendor-dashboard design system
   (vendor-dashboard/src/styles/meridian-tokens.css). */

:root {
  --bg:            hsl(0 0% 100%);
  --surface:       hsl(220 25% 98%);
  --surface-2:     hsl(220 25% 96%);
  --accent:        hsl(214 56% 96%);
  --accent-fg:     hsl(222 46% 27%);
  --ink:           hsl(218 16% 11%);
  --muted:         hsl(217 10% 38%);
  --faint:         hsl(217 12% 52%);
  --border:        hsl(220 16% 88%);
  --border-soft:   hsl(220 20% 93%);
  --primary:       hsl(226 47% 33%);   /* #2d3f7b */
  --primary-700:   hsl(222 46% 27%);
  --primary-300:   hsl(223 55% 70%);
  --primary-tint:  hsl(226 47% 33% / 0.08);
  --shadow:        0 1px 2px hsl(226 47% 20% / 0.06), 0 8px 24px hsl(226 47% 20% / 0.06);
  --radius:        12px;
  --radius-sm:     8px;
  --measure:       42rem;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           hsl(216 18% 8%);
    --surface:      hsl(218 16% 11%);
    --surface-2:    hsl(218 15% 16%);
    --accent:       hsl(220 32% 22%);
    --accent-fg:    hsl(221 56% 80%);
    --ink:          hsl(220 25% 94%);
    --muted:        hsl(217 14% 65%);
    --faint:        hsl(217 12% 55%);
    --border:       hsl(218 14% 22%);
    --border-soft:  hsl(218 14% 18%);
    --primary:      hsl(223 55% 70%);
    --primary-700:  hsl(223 55% 78%);
    --primary-300:  hsl(223 55% 70%);
    --primary-tint: hsl(223 55% 70% / 0.12);
    --shadow:       0 1px 2px hsl(0 0% 0% / 0.4), 0 8px 24px hsl(0 0% 0% / 0.35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Site header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: hsl(0 0% 100% / 0.82);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
@media (prefers-color-scheme: dark) {
  .site-header { background: hsl(216 18% 8% / 0.82); }
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  font-size: 0.95rem;
  color: var(--ink);
  text-transform: uppercase;
}
.wordmark:hover { text-decoration: none; }
.wordmark .mark {
  width: 1.4rem; height: 1.4rem;
  display: inline-grid; place-items: center;
}
.wordmark .mark svg { width: 100%; height: 100%; display: block; }

.site-nav { display: flex; gap: 0.4rem; }
.site-nav a {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-tint); }

/* ---- Layout ---- */
.doc {
  max-width: 64rem;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem) 4rem;
}

.doc-head { margin-bottom: 2.5rem; }
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 0.6rem;
}
.doc-head h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 0.75rem;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.doc-meta strong { color: var(--ink); font-weight: 600; }

.layout { display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
@media (min-width: 960px) {
  .layout { grid-template-columns: 16rem 1fr; align-items: start; }
}

/* ---- Table of contents ---- */
.toc {
  font-size: 0.9rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.1rem 1.25rem;
}
@media (min-width: 960px) {
  .toc { position: sticky; top: 5rem; max-height: calc(100vh - 7rem); overflow-y: auto; }
}
.toc h2 {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.75rem;
  font-weight: 600;
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 0.3rem 0.5rem 0.3rem 0;
  color: var(--muted);
  border-radius: 6px;
  counter-increment: toc;
}
.toc a::before {
  content: counter(toc) ". ";
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.toc a:hover { color: var(--primary); text-decoration: none; }

/* ---- Document body ---- */
.doc-body { min-width: 0; max-width: var(--measure); }
.doc-body section { margin-bottom: 2.5rem; scroll-margin-top: 5rem; }
.doc-body h2 {
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.9rem;
  padding-top: 0.5rem;
  font-weight: 600;
}
.doc-body h2 .num { color: var(--primary); font-variant-numeric: tabular-nums; margin-right: 0.5rem; }
.doc-body h3 {
  font-size: 1.075rem;
  margin: 1.6rem 0 0.5rem;
  font-weight: 600;
}
.doc-body p, .doc-body li { color: var(--ink); }
.doc-body p { margin: 0 0 1rem; }
.doc-body ul, .doc-body ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.doc-body li { margin-bottom: 0.45rem; }
.doc-body strong { font-weight: 600; }
.doc-body section > p:first-of-type { margin-top: 0; }

/* Lead paragraph under the title */
.lead { font-size: 1.15rem; color: var(--muted); line-height: 1.6; }

/* Callout / notice box */
.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}
.notice strong { color: inherit; }

/* Sub-processor / data table */
.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 32rem;
}
caption { text-align: left; color: var(--faint); font-size: 0.85rem; margin-bottom: 0.5rem; }
th, td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
thead th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--border);
}
tbody tr:hover { background: var(--surface); }

/* Placeholder tokens the operator must complete before publishing */
.placeholder {
  background: hsl(38 92% 50% / 0.16);
  border-bottom: 1px dashed hsl(38 80% 40%);
  padding: 0 0.25em;
  border-radius: 3px;
  font-style: normal;
  white-space: nowrap;
}
@media (prefers-color-scheme: dark) {
  .placeholder { background: hsl(38 92% 50% / 0.22); border-bottom-color: hsl(38 92% 60%); }
}

.backtop { font-size: 0.85rem; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
  padding: 2.5rem clamp(1rem, 4vw, 2.5rem);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .inner {
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--primary); }

/* ---- Landing (index) ---- */
.hero {
  max-width: 64rem;
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 6rem) clamp(1rem, 4vw, 2.5rem) 2rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 1rem;
  max-width: 18ch;
}
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 52ch; margin: 0 0 2rem; }
.cards {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem) 4rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  display: block;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
  color: var(--ink);
}
.card:hover { border-color: var(--primary-300); transform: translateY(-2px); text-decoration: none; }
.card h2 { font-size: 1.2rem; margin: 0.4rem 0 0.5rem; }
.card p { color: var(--muted); margin: 0; font-size: 0.95rem; }
.card .arrow { color: var(--primary); font-weight: 600; font-size: 0.9rem; margin-top: 1rem; display: inline-block; }
