/* Relay Oh — shared legal-doc stylesheet (terms + privacy) */
:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #14110f;
  --ink-soft: #6b655f;        /* AA pass on --bg (~5.3:1) */
  --ink-faint: #8a847d;       /* decorative only — borderline AA */
  --line: rgba(20, 17, 15, 0.09);
  --accent: #f26b3a;          /* brand; large-text use only */
  --accent-strong: #b85320;   /* AA pass on --bg (~5.2:1) for links/small text */
  --hl: rgba(242, 107, 58, 0.10);
  --focus: #2563eb;           /* focus ring — high-contrast blue */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
html, body { min-height: 100%; }
body {
  font-family: 'Geist', ui-sans-serif, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.011em;
}

/* Focus visible — keyboard navigation */
:focus { outline: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Skip-to-content link */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  border-radius: 8px;
  z-index: 100;
  transform: translateY(-200%);
  transition: transform .15s ease;
}
.skip-link:focus,
.skip-link:focus-visible { transform: translateY(0); }

/* Visually hidden — announced by screen readers, invisible on screen */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.page {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 48px 24px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}
.page::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 92% -10%, rgba(242, 107, 58, 0.05), transparent 60%);
  z-index: 0;
}
.page > * { position: relative; z-index: 1; }

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: inline-flex;
  align-items: baseline;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.028em;
  text-decoration: none;
  color: inherit;
}
.logo .ink { color: var(--ink); }
.logo .oh { color: var(--accent); position: relative; display: inline-block; }
.logo .oh .sparks {
  position: absolute; top: -9px; right: -10px;
  width: 20px; height: 16px; color: var(--accent);
}
.back-link {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .15s ease;
}
.back-link:hover { color: var(--ink); }
.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 22px;
}
.login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.login:hover {
  border-color: rgba(20, 17, 15, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -8px rgba(20, 17, 15, 0.18);
}
.login .arrow {
  color: var(--ink-soft);
  display: inline-block;
  transition: transform .15s ease, color .15s ease;
}
.login:hover .arrow { transform: translateX(2px); color: var(--accent); }

/* Doc layout */
main.doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 64px;
  align-items: start;
  padding: clamp(48px, 7vw, 88px) 0 64px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
@media (max-width: 880px) {
  main.doc { grid-template-columns: 1fr; gap: 40px; }
}

/* Doc head */
.kicker {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 18px;
}
.doc h1 {
  font-size: clamp(40px, 5.4vw, 64px);
  font-weight: 700;
  letter-spacing: -0.034em;
  line-height: 1.02;
  margin-bottom: 18px;
  text-wrap: balance;
}
.doc .meta {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.doc .meta b { color: var(--ink); font-weight: 500; }

.callout {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px 22px;
  background: var(--hl);
  border: 1px solid rgba(242, 107, 58, 0.25);
  border-radius: 12px;
  margin-bottom: 40px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}
.callout::before {
  content: "";
  margin-top: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(242, 107, 58, 0.15);
}
.callout b { font-weight: 600; }

/* Prose */
.prose { color: var(--ink); font-size: 16.5px; line-height: 1.65; }
.prose p,
.prose ul,
.prose ol { margin-bottom: 18px; max-width: 64ch; }
.prose b, .prose strong { font-weight: 600; color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--ink); }

.prose section { padding-top: 36px; scroll-margin-top: 88px; }
.prose section:first-of-type { padding-top: 12px; }
.prose section h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.018em;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--ink);
}
.prose section h2 .num {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.04em;
  min-width: 26px;
}
.prose .small {
  font-size: 13px;
  color: var(--ink-soft);
  font-family: 'Geist Mono', ui-monospace, monospace;
}

/* TOC sidebar */
.toc {
  position: sticky;
  top: 32px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}
.toc .toc-label {
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  font-size: 11px;
}
.toc ol { list-style: none; padding: 0; counter-reset: toc; display: flex; flex-direction: column; gap: 6px; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 0;
  line-height: 1.4;
  min-height: 28px;
  transition: color .15s ease;
}
.toc a::before { content: counter(toc, decimal-leading-zero); color: var(--ink-faint); }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent-strong); }
.toc a.active::before { color: var(--accent-strong); }

@media (max-width: 880px) {
  .toc { display: none; }
}

/* Footer */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
  font-family: 'Geist Mono', ui-monospace, monospace;
  gap: 24px;
}
footer .links { display: flex; gap: 28px; }
footer a { color: var(--ink-soft); text-decoration: none; transition: color .15s ease; }
footer a:hover { color: var(--ink); }
footer a.current { color: var(--ink); }

@media (max-width: 640px) {
  .page { padding: 22px 20px; }
  main.doc { padding: 40px 0 32px; }
  .doc h1 { font-size: 40px; }
  .prose { font-size: 16px; }
  footer { flex-direction: column; align-items: flex-start; gap: 14px; padding-top: 20px; }
  .header-actions { gap: 12px; }
  .login { padding: 7px 13px; font-size: 13px; }
}

/* Reusable logo+footer fragments share styles via the .logo/.sparks/footer rules. */
