/* Shared styles for Roger's legal pages (privacy, terms). */

:root {
  --ink: #0A0A0A;
  --ink-2: #404040;      /* 10.4:1 on white */
  --ink-3: #595959;      /*  7.0:1 on white */
  --ink-4: #6B6B6B;      /*  5.3:1 on white */
  --rule: #E6E6E6;
  --rule-strong: #D4D4D4;
  --surface: #FFFFFF;
  --surface-2: #FAFAFA;
  --focus: #1F3B60;
  --sans: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  --gutter: clamp(24px, 5vw, 72px);
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

/* ---------- Focus ---------- */

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

.skip-link {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 100;
  transform: translateY(-200%);
  padding: 12px 20px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: var(--ink);
  color: #FFFFFF;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.skip-link:focus { transform: translateY(0); }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}

.site-header__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.wordmark img { width: 96px; height: auto; display: block; }

.call-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 220ms, color 220ms;
}

.call-link span { font-family: var(--mono); font-size: 13px; color: var(--ink-4); }
.call-link:hover { background: var(--ink); color: #FFFFFF; }
.call-link:hover span { color: #FFFFFF; }

/* ---------- Page title ---------- */

.page-head {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 88px) var(--gutter) clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.page-head h1 {
  margin: 0;
  font-size: clamp(34px, 5.5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}

.page-meta {
  margin: 28px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  font-size: 15px;
  color: var(--ink-3);
}

.page-meta > div { min-width: 0; }

.page-meta dt {
  margin: 0 0 2px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.page-meta dd { margin: 0; }

/* ---------- Layout ---------- */

.layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) var(--gutter) clamp(64px, 8vw, 104px);
  display: grid;
  gap: clamp(32px, 4vw, 64px);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 1024px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr); }
}

/* ---------- Table of contents ---------- */

.toc {
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--surface-2);
  padding: 8px 20px;
}

.toc > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  list-style: none;
}

.toc > summary::-webkit-details-marker { display: none; }

.toc > summary::after {
  content: '';
  margin-left: auto;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toc[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }

.toc ol {
  margin: 0;
  padding: 4px 0 12px;
  list-style: none;
  counter-reset: toc;
}

.toc li { counter-increment: toc; }

.toc a {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  font-size: 15px;
  line-height: 1.35;
  color: var(--ink-3);
  text-decoration: none;
}

.toc a::before {
  content: counter(toc);
  flex: 0 0 auto;
  min-width: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
}

.toc a:hover { color: var(--ink); }
.toc a[aria-current='true'] { color: var(--ink); font-weight: 500; }
.toc a[aria-current='true']::before { color: var(--ink); }

@media (min-width: 1024px) {
  .toc {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .toc > summary { cursor: default; }
  .toc > summary::after { display: none; }
}

/* ---------- Document body ---------- */

.doc { max-width: 72ch; }
.doc > * + * { margin-top: 1.1em; }

.doc .lede {
  font-size: clamp(18px, 2vw, 20px);
  line-height: 1.55;
  color: var(--ink-2);
}

.doc section {
  margin-top: clamp(44px, 5vw, 64px);
  scroll-margin-top: 24px;
}

.doc h2 {
  margin: 0 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

.doc h3 {
  margin: 36px 0 12px;
  font-size: clamp(17px, 1.8vw, 19px);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.doc p { margin: 0; color: var(--ink-2); }
.doc ul,
.doc ol { margin: 0; padding-left: 1.6em; color: var(--ink-2); }
.doc ul { padding-left: 1.3em; }
.doc li { margin-top: 0.6em; }
/* Numbered clauses carry meaning in the terms, so the marker reads as
   firmly as the text it labels. */
.doc ol > li::marker { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.doc ul > li::marker { color: var(--ink-4); }
.doc strong { font-weight: 600; color: var(--ink); }

.doc a { color: var(--focus); text-underline-offset: 3px; }
.doc a:hover { color: var(--ink); }

/* Passages the source document sets in all caps. Rendered in sentence case so
   they stay readable; the legal emphasis is carried by the callout treatment. */
.callout {
  margin: 28px 0;
  padding: 20px 24px;
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--surface-2);
}

.callout p { color: var(--ink); }
.callout p + p { margin-top: 0.9em; }

.callout__label {
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.contact-card {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--surface-2);
}

/* Several contact routes stack rather than running together, and the email
   address is allowed to break so it cannot push the card sideways on a
   narrow phone. */
.contact-card a {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  font-family: var(--mono);
  font-size: clamp(16px, 2.2vw, 20px);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-underline-offset: 5px;
  overflow-wrap: anywhere;
}

.contact-card a + a { margin-top: 4px; }

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(44px, 5vw, 64px);
  min-height: 44px;
  font-size: 15px;
  color: var(--ink-3);
  text-decoration: none;
}

.back-to-top:hover { color: var(--ink); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); }

.site-footer__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--ink-4);
}

.site-footer img { width: 96px; height: auto; display: block; }

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 8px 24px;
  flex-wrap: wrap;
  align-items: center;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-4);
  text-decoration: none;
}

.site-footer a:hover { color: var(--ink); }
.site-footer a[aria-current='page'] { color: var(--ink); font-weight: 500; }

/* ---------- Forced colors ---------- */

@media (forced-colors: active) {
  .toc, .callout, .contact-card { border: 1px solid CanvasText; }
  .call-link { border-color: CanvasText; }
}

/* ---------- Print ---------- */

@media print {
  .site-header, .toc, .back-to-top, .skip-link, .site-footer ul { display: none; }
  body { font-size: 11pt; color: #000; }
  .layout { display: block; padding: 0; }
  .doc { max-width: none; }
  .doc h2, .doc h3 { break-after: avoid; page-break-after: avoid; }
  .callout, .contact-card { background: none; break-inside: avoid; }
  .doc a::after { content: ' (' attr(href) ')'; font-size: 9pt; }
}
