/* ScrubLog Legal — shared design tokens & layout
   Palette anchored to the app's own theme: dark charcoal surfaces,
   white text, OR-blue accent. Warning callouts (patient-data
   prohibition) use a separate amber tone, never the blue accent. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --border: rgba(16, 24, 32, 0.12);
  --text: #121820;
  --text-muted: rgba(18, 24, 32, 0.64);
  --accent: #3e6484;
  --accent-soft: rgba(62, 100, 132, 0.1);
  --warn: #a85c1b;
  --warn-soft: rgba(168, 92, 27, 0.1);
  --warn-border: rgba(168, 92, 27, 0.38);
  --focus: #3e6484;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141b;
    --surface: #161f28;
    --surface-2: #1c2733;
    --border: rgba(255, 255, 255, 0.09);
    --text: #f3f5f7;
    --text-muted: rgba(243, 245, 247, 0.66);
    --accent: #89afcc;
    --accent-soft: rgba(137, 175, 204, 0.14);
    --warn: #e0a458;
    --warn-soft: rgba(224, 164, 88, 0.12);
    --warn-border: rgba(224, 164, 88, 0.4);
    --focus: #89afcc;
  }
}

:root[data-theme="dark"] {
  --bg: #0e141b;
  --surface: #161f28;
  --surface-2: #1c2733;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f3f5f7;
  --text-muted: rgba(243, 245, 247, 0.66);
  --accent: #89afcc;
  --accent-soft: rgba(137, 175, 204, 0.14);
  --warn: #e0a458;
  --warn-soft: rgba(224, 164, 88, 0.12);
  --warn-border: rgba(224, 164, 88, 0.4);
  --focus: #89afcc;
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .nav, .eyebrow, .topbar, button, .pill {
  font-family: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
}

.mono, time, .doc-dates, .meta {
  font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

/* Top navigation — present identically on every page */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 32px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand .dot { color: var(--accent); }
.brand .suite { font-weight: 500; color: var(--text-muted); font-size: 13px; }

.nav { display: flex; gap: clamp(10px, 3vw, 22px); flex-wrap: wrap; }
.nav a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* Document shell */
.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 24px) 80px;
}

.doc-header { margin-bottom: 40px; }

.doc-dates {
  font-size: 12.5px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}
.doc-dates span + span::before { content: "·"; margin: 0 8px; color: var(--border); }

h1 {
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  text-wrap: balance;
}

.dek {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  color: var(--text-muted);
  font-size: 17px;
  max-width: 60ch;
  margin: 0;
}

section.clause { margin: 40px 0; scroll-margin-top: 76px; }

h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
h2 .num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  flex-shrink: 0;
}

h3 {
  font-size: 15.5px;
  font-weight: 600;
  margin: 22px 0 8px;
  color: var(--text);
}

p { margin: 0 0 14px; max-width: 68ch; }
ul, ol { margin: 0 0 14px; padding-left: 22px; max-width: 64ch; }
li { margin-bottom: 6px; }
strong { font-weight: 600; }

.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  border-left: 3px solid var(--warn);
  border-radius: 6px;
  padding: 16px 18px;
  margin: 18px 0 20px;
}
.callout svg { flex-shrink: 0; margin-top: 2px; color: var(--warn); }
.callout p { margin: 0; max-width: 60ch; font-size: 16px; }
.callout p + p { margin-top: 8px; }
.callout strong { color: var(--warn); }

.table-wrap { overflow-x: auto; margin: 16px 0 20px; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-family: "IBM Plex Sans", sans-serif; font-size: 14.5px; min-width: 480px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; color: var(--text-muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }

.contact-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  margin: 18px 0;
}
.contact-card .label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.contact-card a.email { display: inline-block; max-width: 100%; font-size: clamp(15px, 4.2vw, 18px); font-weight: 600; font-family: "IBM Plex Mono", monospace; overflow-wrap: break-word; word-break: break-word; }

.flag {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  border-radius: 4px;
  padding: 1px 7px;
  margin-left: 8px;
  vertical-align: middle;
}

footer.site {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 40px;
}
.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 24px) 40px;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-inner .footer-links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.footer-inner .footer-links a { color: var(--text-muted); font-family: "IBM Plex Sans", sans-serif; font-weight: 500; }
.footer-inner .footer-links a:hover { color: var(--text); }
.footer-inner p { max-width: none; margin: 0 0 6px; font-size: 12.5px; line-height: 1.6; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav { gap: 12px; }
}
