/* Ridgewill Legal Information. Generated pages live beside this file; the
   markup comes from scripts/build-legal.mjs. */

:root {
  --blue-900: #12307f;
  --blue-700: #1e4fd0;
  --blue-600: #2b63e8;
  --blue-500: #3d78f0;
  --sky: #4081e9;
  --teal: #40e0d0;
  --teal-ink: #0b7d73;
  --ink: #16233d;
  --ink-2: #3b4a66;
  --ink-3: #5b6884;
  --line: #e1e6ef;
  --line-2: #cfd7e6;
  --wash: #f3f6fb;
  --wash-2: #e8eef8;
  --paper: #ffffff;
  --bar-h: 64px;
  --radius: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--bar-h) + 20px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Public Sans', -apple-system, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #cdeffb; color: var(--ink); }
a { color: var(--blue-700); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--blue-900); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blue-700); outline-offset: 3px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.docs-nav a svg, .lib-title svg { margin-left: 4px; vertical-align: -1px; color: var(--ink-3); }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 30;
  background: var(--paper); color: var(--ink); padding: 8px 14px; border-radius: 6px;
  font-weight: 600; transition: top 0.2s var(--ease);
}
.skip:focus { top: 12px; }

/* ── Top bar: clear over the band, solid once the band scrolls away ───────── */

.sentinel { position: absolute; top: 0; height: 1px; width: 1px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--bar-h);
  color: #fff;
  background: transparent;
  transition: background-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.topbar.is-stuck {
  background: var(--blue-700);
  box-shadow: 0 6px 18px -8px rgba(18, 48, 127, 0.55);
}
.topbar-inner {
  max-width: 1200px; height: 100%; margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { color: #fff; }
.brand .mark { flex: none; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.brand-divider { width: 1px; height: 22px; background: rgba(255, 255, 255, 0.45); margin: 0 6px; }
.brand-section {
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92); white-space: nowrap;
}
.to-site {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  color: #fff; text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.5);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.to-site:hover { color: #fff; background: rgba(255, 255, 255, 0.14); border-color: #fff; }
.to-site:focus-visible, .brand:focus-visible { outline-color: #fff; }

/* ── Band ─────────────────────────────────────────────────────────────────── */

.band {
  margin-top: calc(var(--bar-h) * -1);
  padding-top: var(--bar-h);
  /* The art's sky is --sky at its left edge; the brand gradient fades into it. */
  background:
    linear-gradient(90deg, var(--blue-700) 0%, rgba(64, 129, 233, 0) 62%),
    url('/assets/legal/ridges.jpg') right bottom / auto 100% no-repeat,
    var(--sky);
  color: #fff;
}
.band-inner { max-width: 1200px; margin: 0 auto; padding: 44px 32px 52px; }
.band-title {
  margin: 0; max-width: 16ch;
  font-size: clamp(30px, 4vw, 44px); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em;
  text-shadow: 0 1px 12px rgba(18, 48, 127, 0.25);
}

.site-status {
  margin: 0; padding: 14px max(32px, calc((100vw - 1200px) / 2 + 32px));
  font-size: 15px; line-height: 1.5; color: #5a3a00;
  background: #fff6dc; border-bottom: 1px solid #f1e0a9;
}
.site-status a { color: #6b4500; }

/* ── Layout ───────────────────────────────────────────────────────────────── */

.layout {
  max-width: 1200px; margin: 0 auto; padding: 48px 32px 72px;
  display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 56px;
  align-items: start;
}
main:focus { outline: none; }

/* Document list */
.docs-nav { position: sticky; top: calc(var(--bar-h) + 24px); max-height: calc(100vh - var(--bar-h) - 48px); overflow: auto; }
.docs-disclosure > summary { display: none; }
.docs-disclosure > summary::-webkit-details-marker { display: none; }
.nav-group {
  margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.nav-group ~ .nav-group { margin-top: 28px; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.docs-nav li a {
  display: block; margin-left: -1px; padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  color: var(--ink-2); text-decoration: none; font-size: 15px; line-height: 1.4;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.docs-nav li a:hover { color: var(--ink); border-left-color: var(--line-2); }
.docs-nav li a[aria-current='page'] { color: var(--ink); font-weight: 600; border-left-color: var(--teal); }

/* ── Document ─────────────────────────────────────────────────────────────── */

.doc { max-width: 760px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-3); display: inline-flex; padding: 2px; }
.crumbs a:hover { color: var(--blue-700); }
.crumbs svg { flex: none; }

.doc h1 {
  margin: 0 0 22px;
  font-size: clamp(30px, 3.4vw, 40px); font-weight: 800; line-height: 1.12; letter-spacing: -0.025em;
  text-wrap: balance;
}

.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding-bottom: 24px; border-bottom: 1px solid var(--line);
}
.version { display: inline-flex; align-items: center; gap: 12px; }
.version-label { font-size: 14px; color: var(--ink-3); }
.select { position: relative; display: inline-flex; align-items: center; }
.select select {
  appearance: none; -webkit-appearance: none;
  font: 600 15px/1.2 'Public Sans', system-ui, sans-serif; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 10px 40px 10px 14px; min-height: 44px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(22, 35, 61, 0.06);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.select select:hover { border-color: var(--ink-3); }
.select select:focus-visible { outline: none; border-color: var(--blue-700); box-shadow: 0 0 0 3px rgba(30, 79, 208, 0.22); }
.select svg { position: absolute; right: 14px; pointer-events: none; color: var(--ink-2); }
.effective { margin: 0; font-size: 14px; color: var(--ink-3); }
.changes { font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.changes:hover { text-decoration: underline; }
.changes .count { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--wash-2); color: var(--ink-2); font-weight: 500; font-size: 12.5px; }
.effective time, .lib-date time { font-variant-numeric: tabular-nums; color: var(--ink-2); }

.older {
  margin: 20px 0 0; padding: 12px 16px; border-radius: 8px;
  background: var(--wash-2); color: var(--ink); font-size: 15px;
}

/* Contents */
.contents { margin: 32px 0 8px; }
.contents h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.contents summary { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; list-style: none; cursor: default; pointer-events: none; }
.contents summary::-webkit-details-marker { display: none; }
.contents summary svg { display: none; }
.contents ol { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.contents li { break-inside: avoid; }
.contents a {
  display: grid; grid-template-columns: 2.1em 1fr; padding: 5px 0;
  font-size: 15px; line-height: 1.4; color: var(--blue-700); text-decoration: none;
}
.contents a:hover span:last-child, .contents a:hover { text-decoration: underline; }
.contents .num { color: var(--ink-3); font-variant-numeric: tabular-nums; text-decoration: none; }

/* Prose */
.prose { margin-top: 16px; }
.prose section { padding-top: 8px; }
.prose h2 {
  margin: 44px 0 14px;
  font-size: 23px; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; text-wrap: balance;
}
.prose h2 .num { color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 0.15em; }
.prose h3 { margin: 30px 0 8px; font-size: 18px; font-weight: 700; line-height: 1.35; }
.prose p, .prose li { max-width: 68ch; }
.prose p { margin: 0 0 16px; }
.prose strong { font-weight: 650; color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 1.4em; }
.prose li { margin: 0 0 8px; padding-left: 0.2em; }
.prose li::marker { color: var(--ink-3); }
.prose ol li::marker { font-variant-numeric: tabular-nums; }
.prose a[href^='#section-'] { font-weight: 600; }

/* Key points: the plain-language summary, set apart but not shouting */
.prose .key-points {
  margin-top: 36px; padding: 6px 28px 10px; border-radius: var(--radius);
  background: var(--wash); border: 1px solid var(--line);
}
.prose .key-points h2 { margin-top: 20px; font-size: 19px; }
.prose .key-points ul { padding-left: 1.2em; }

/* Callout: the one thing a document asks the reader to do */
.prose .callout {
  margin: 4px 0 24px; padding: 20px 24px; border-radius: var(--radius);
  background: var(--wash-2); border: 1px solid var(--line-2);
}
.prose .callout p { margin: 0; max-width: 60ch; }
.prose .callout p + p { margin-top: 8px; color: var(--ink-2); }
.prose .callout p:first-child { font-size: 19px; line-height: 1.45; }
.prose .callout a { font-weight: 700; text-decoration-thickness: 2px; }

/* Tables */
.table-wrap {
  margin: 8px 0 24px; overflow-x: auto; border-radius: 8px; border: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}
.table-wrap:focus-visible { outline-offset: 2px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.prose thead th {
  background: var(--wash-2); color: var(--ink); text-align: left; font-weight: 650;
  padding: 12px 16px; vertical-align: bottom;
}
.prose tbody th, .prose td { padding: 12px 16px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.prose tbody th { font-weight: 600; color: var(--ink); min-width: 10em; }
.prose tbody tr:first-child th, .prose tbody tr:first-child td { border-top: 0; }
.prose thead + tbody tr:first-child th, .prose thead + tbody tr:first-child td { border-top: 1px solid var(--line); }
.prose td { color: var(--ink-2); }

/* Version history */
.history { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.history h2 { margin: 0 0 16px; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.history > ol { list-style: none; margin: 0; padding: 0; }
.history > ol > li { position: relative; padding: 0 0 20px 24px; }
.history > ol > li::before {
  content: ''; position: absolute; left: 4px; top: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--line-2);
}
.history > ol > li::after { content: ''; position: absolute; left: 8px; top: 21px; bottom: 0; width: 1px; background: var(--line); }
.history > ol > li:last-child::after { display: none; }
.history > ol > li[aria-current='true']::before { border-color: var(--teal-ink); background: var(--teal); }
.history-date { font-weight: 600; color: var(--blue-700); }
.history > ol > li[aria-current='true'] .history-date { color: var(--ink); }
.history p { margin: 4px 0 0; max-width: 68ch; font-size: 15px; color: var(--ink-2); }
/* A summary is markdown: a lead line and a list, usually (2026-10-16). */
.history .summary ul, .history .summary ol { margin: 6px 0 0; padding-left: 1.25em; max-width: 68ch; font-size: 15px; color: var(--ink-2); }
.history .summary li { margin: 3px 0; }
.history .summary li::marker { color: var(--ink-3); }
.history .summary strong { color: var(--ink); font-weight: 600; }

.to-top { margin: 32px 0 0; }
.to-top a { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; text-decoration: none; }
.to-top a:hover { text-decoration: underline; }

/* ── Library (the /legal/ home) ───────────────────────────────────────────── */

.home .lede { margin: 0 0 8px; max-width: 62ch; font-size: 18px; color: var(--ink-2); }
.library-group { margin-top: 40px; }
.library-group h2 { margin: 0 0 2px; font-size: 21px; font-weight: 700; letter-spacing: -0.015em; }
.group-note { margin: 0 0 12px; color: var(--ink-3); font-size: 15px; }
.library { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.library li { border-bottom: 1px solid var(--line); }
.library a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 24px; align-items: baseline;
  padding: 16px 12px; margin: 0 -12px; border-radius: 8px; text-decoration: none; color: var(--ink);
  transition: background-color 0.15s var(--ease);
}
.library a:hover { background: var(--wash); }
.lib-title { font-size: 17px; font-weight: 650; color: var(--blue-700); }
.library a:hover .lib-title { text-decoration: underline; text-underline-offset: 0.18em; }
.lib-date { grid-column: 2; grid-row: 1; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.lib-desc { grid-column: 1 / -1; font-size: 15px; color: var(--ink-2); max-width: 64ch; }
.questions { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.questions h2 { margin: 0 0 6px; font-size: 19px; }
.questions p { margin: 0; color: var(--ink-2); }

/* ── Footer ───────────────────────────────────────────────────────────────── */

.foot { border-top: 1px solid var(--line); background: var(--wash); padding: 24px 32px 28px; text-align: center; }
.foot p { margin: 4px 0; font-size: 13px; color: var(--ink-3); }
.foot a { color: var(--ink-2); }

/* ── Narrow screens ───────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  :root { --bar-h: 56px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 20px 16px 56px; }
  .topbar-inner, .band-inner { padding-left: 16px; padding-right: 16px; }
  .band-inner { padding-top: 28px; padding-bottom: 32px; }
  .band { background-position: 0 0, 72% bottom, 0 0; }
  .site-status { padding: 12px 16px; font-size: 14px; }

  .docs-nav { position: static; max-height: none; overflow: visible; }
  .docs-disclosure { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--paper); }
  .docs-disclosure > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    list-style: none; cursor: pointer; padding: 12px 16px; min-height: 48px;
    font-weight: 650; font-size: 15px;
  }
  .docs-disclosure > summary svg { transition: transform 0.2s var(--ease); color: var(--ink-2); }
  .docs-disclosure[open] > summary svg { transform: rotate(180deg); }
  .docs-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
  .docs-disclosure > .nav-group, .docs-disclosure > ul { margin-left: 16px; margin-right: 16px; }
  .docs-disclosure > .nav-group:first-of-type { margin-top: 14px; }
  .docs-disclosure > ul:last-child { margin-bottom: 14px; }
  .nav-group ~ .nav-group { margin-top: 18px; }
  .docs-nav li a { padding: 9px 0 9px 14px; }

  .contents ol { columns: 1; }
  .contents summary {
    pointer-events: auto; cursor: pointer; justify-content: space-between; margin: 0;
    padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 48px;
  }
  .contents summary svg { display: block; color: var(--ink-2); transition: transform 0.2s var(--ease); }
  .contents details[open] summary svg { transform: rotate(180deg); }
  .contents details[open] summary { margin-bottom: 8px; }
  .contents h2 { font-size: 19px; }
}

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .wide { display: none; }
  .brand-name { font-size: 17px; }
  .brand-divider { margin: 0 2px; height: 18px; }
  .brand-section { font-size: 12px; }
  .to-site { font-size: 13px; padding: 6px 10px; }
  .meta { gap: 10px; }
  .version { width: 100%; flex-direction: column; align-items: stretch; gap: 6px; }
  .select, .select select { width: 100%; }
  .prose .key-points { padding: 4px 18px 8px; margin-left: -4px; margin-right: -4px; }
  .prose h2 { font-size: 21px; margin-top: 36px; }
  .library a { grid-template-columns: minmax(0, 1fr); }
  .lib-date { grid-column: 1; grid-row: auto; }
}

/* ── Print: just the document ─────────────────────────────────────────────── */

@media print {
  .topbar, .band, .docs-nav, .foot, .skip, .to-top, .contents, .select svg, .site-status { display: none !important; }
  .layout { display: block; padding: 0; max-width: none; }
  body { font-size: 11pt; color: #000; }
  .doc { max-width: none; }
  .meta { border: 0; padding: 0; }
  .select select { border: 0; padding: 0; box-shadow: none; font-weight: 400; }
  .prose a { color: inherit; text-decoration: none; }
  .prose .key-points { background: none; }
  .table-wrap { overflow: visible; }
  .prose h2 { break-after: avoid; }
  .prose tr { break-inside: avoid; }
}
