/* ClientAhead legal pages — readable, product-specific public documents. */

html.page-legal {
  color-scheme: light;
  scroll-behavior: smooth;
}

html.page-legal body {
  background: #f4f1ea;
  color: #18211d;
}

html.page-legal .site-header {
  background: rgba(249, 247, 241, 0.9);
  border-bottom-color: rgba(24, 33, 29, 0.13);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
}

html.page-legal .site-header.is-scrolled,
html.page-legal body.nav-open .site-header {
  background: rgba(249, 247, 241, 0.98);
  box-shadow: 0 12px 30px rgba(24, 33, 29, 0.08);
}

html.page-legal .site-header :where(.nav-link, .nav-toggle, .nav-toggle-label, .nav-icon) {
  color: #18211d;
}

html.page-legal .site-header .site-logo-lockup {
  filter: brightness(0);
}

.legal-page {
  --legal-ink: #18211d;
  --legal-muted: #63706a;
  --legal-paper: #f4f1ea;
  --legal-surface: #fffdfa;
  --legal-accent: #17614d;
  --legal-accent-soft: #dcece4;
  --legal-line: rgba(24, 33, 29, 0.16);
  background: var(--legal-paper);
  color: var(--legal-ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-width: 0;
  overflow: hidden;
}

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

.legal-page :where(h1, h2, h3, p, ol, ul, dl, dd) {
  margin: 0;
}

.legal-page :where(ol, ul) {
  padding: 0;
}

.legal-page a {
  color: inherit;
}

.legal-page :where(a, summary):focus-visible {
  outline: 3px solid #17614d;
  outline-offset: 4px;
}

.legal-shell {
  margin-inline: auto;
  max-width: 1220px;
  padding-inline: clamp(20px, 4vw, 52px);
  width: 100%;
}

.legal-hero {
  background:
    linear-gradient(115deg, rgba(23, 97, 77, 0.1), transparent 38%),
    linear-gradient(180deg, #fbfaf5 0%, #eeeae1 100%);
  border-bottom: 1px solid var(--legal-line);
  padding-block: calc(var(--header-h, 72px) + clamp(50px, 7vw, 88px)) clamp(64px, 8vw, 108px);
}

.legal-breadcrumb {
  align-items: center;
  color: #68736c;
  display: flex;
  font-size: 0.79rem;
  font-weight: 650;
  gap: 9px;
  margin-bottom: clamp(38px, 6vw, 72px);
}

.legal-breadcrumb a:hover {
  color: var(--legal-accent);
}

.legal-hero__grid {
  align-items: end;
  display: grid;
  gap: clamp(38px, 8vw, 120px);
  grid-template-columns: minmax(0, 1.28fr) minmax(230px, 0.48fr);
}

.legal-eyebrow {
  color: var(--legal-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.legal-hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.5rem, 7vw, 6.9rem);
  font-weight: 400;
  letter-spacing: -0.072em;
  line-height: 0.9;
  margin-top: 20px;
  max-width: 860px;
  text-wrap: balance;
}

.legal-hero__lead {
  color: var(--legal-muted);
  font-size: clamp(1.03rem, 1.55vw, 1.22rem);
  line-height: 1.72;
  margin-top: 28px;
  max-width: 720px;
}

.legal-meta {
  border-top: 1px solid var(--legal-line);
  display: grid;
  gap: 0;
}

.legal-meta > div {
  border-bottom: 1px solid var(--legal-line);
  display: grid;
  gap: 7px;
  padding-block: 17px;
}

.legal-meta dt {
  color: #6b756e;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-meta dd {
  color: var(--legal-ink);
  font-size: 0.93rem;
  font-weight: 690;
  line-height: 1.45;
}

.legal-content {
  background: var(--legal-surface);
  padding-block: clamp(58px, 8vw, 112px);
}

.legal-layout {
  align-items: start;
  display: grid;
  gap: clamp(44px, 8vw, 110px);
  grid-template-columns: minmax(205px, 0.38fr) minmax(0, 1fr);
}

.legal-sidebar {
  display: grid;
  gap: 28px;
  position: sticky;
  top: calc(var(--header-h, 72px) + 30px);
}

.legal-toc {
  border-top: 1px solid var(--legal-line);
  padding-top: 16px;
}

.legal-toc > p {
  color: var(--legal-accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.legal-toc ol {
  display: grid;
  gap: 1px;
  list-style: none;
  margin-top: 13px;
}

.legal-toc a {
  color: #5a6660;
  display: block;
  font-size: 0.8rem;
  font-weight: 560;
  line-height: 1.35;
  padding: 6px 0;
  text-decoration: none;
  transition: color 160ms ease, padding-left 160ms ease;
}

.legal-toc a:hover {
  color: var(--legal-accent);
  padding-left: 5px;
}

.legal-contact {
  background: #173d31;
  border-radius: 12px;
  color: #fff;
  display: grid;
  gap: 8px;
  padding: 22px;
  text-decoration: none;
}

.legal-contact > span {
  color: #b8e4d2;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.legal-contact strong {
  font-size: 1.04rem;
  letter-spacing: -0.025em;
}

.legal-contact em {
  color: rgba(255, 255, 255, 0.73);
  font-size: 0.77rem;
  font-style: normal;
  overflow-wrap: anywhere;
}

.legal-contact:hover {
  background: #17614d;
}

.legal-document {
  max-width: 800px;
}

.legal-document__notice {
  background: #e4f0ea;
  border-left: 4px solid var(--legal-accent);
  margin-bottom: 18px;
  padding: clamp(24px, 3vw, 34px);
}

.legal-document__notice .legal-eyebrow {
  font-size: 0.64rem;
}

.legal-document__notice h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 400;
  letter-spacing: -0.048em;
  line-height: 1.05;
  margin-top: 14px;
}

.legal-document__notice > p:last-child {
  color: #4f6258;
  font-size: 0.94rem;
  line-height: 1.68;
  margin-top: 15px;
}

.legal-document > section {
  border-top: 1px solid var(--legal-line);
  padding-block: clamp(34px, 5vw, 54px);
  scroll-margin-top: calc(var(--header-h, 72px) + 22px);
}

.legal-document > section h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3.25vw, 2.55rem);
  font-weight: 400;
  letter-spacing: -0.052em;
  line-height: 1.04;
}

.legal-richtext {
  color: #4e5d55;
  font-size: 0.98rem;
  line-height: 1.76;
  margin-top: 17px;
  max-width: 740px;
}

.legal-richtext :where(p + p, p + ul, p + ol, ul + p, ol + p) {
  margin-top: 15px;
}

.legal-richtext :where(ul, ol) {
  display: grid;
  gap: 9px;
  padding-left: 1.25rem;
}

.legal-richtext li {
  padding-left: 0.2rem;
}

.legal-richtext strong {
  color: #26372e;
  font-weight: 750;
}

.legal-table-wrap {
  border: 1px solid var(--legal-line);
  margin-top: 18px;
  overflow-x: auto;
}

.legal-richtext table {
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.55;
  min-width: 620px;
  width: 100%;
}

.legal-richtext th,
.legal-richtext td {
  border-bottom: 1px solid var(--legal-line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
}

.legal-richtext th {
  background: var(--legal-accent-soft);
  color: #26372e;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-richtext tr:last-child td {
  border-bottom: 0;
}

.legal-richtext a {
  color: var(--legal-accent);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.legal-related {
  border-top: 1px solid var(--legal-line);
  padding-top: 28px;
}

.legal-related > p {
  color: var(--legal-accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.legal-related > div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 13px;
}

.legal-related a {
  border: 1px solid var(--legal-line);
  border-radius: 999px;
  color: #3c4d45;
  font-size: 0.78rem;
  font-weight: 670;
  padding: 8px 12px;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.legal-related a:hover {
  background: var(--legal-accent);
  border-color: var(--legal-accent);
  color: #fff;
}

.legal-cta {
  background: #122a22;
  color: #fff;
  padding-block: clamp(58px, 8vw, 100px);
}

.legal-cta__panel {
  align-items: center;
  border-block: 1px solid rgba(255, 255, 255, 0.17);
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-block: clamp(38px, 5vw, 64px);
}

.legal-cta .legal-eyebrow {
  color: #9cddc2;
}

.legal-cta h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 4.5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.98;
  margin-top: 13px;
}

.legal-cta__panel > div > p:last-child {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.98rem;
  line-height: 1.7;
  margin-top: 16px;
  max-width: 670px;
}

.legal-cta__panel > a {
  align-items: center;
  background: #bde5d2;
  border-radius: 9px;
  color: #11251e;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 780;
  gap: 14px;
  justify-content: center;
  letter-spacing: 0.04em;
  min-height: 50px;
  padding: 14px 19px;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 160ms ease, transform 160ms ease;
}

.legal-cta__panel > a span {
  font-size: 1.16rem;
  line-height: 1;
}

.legal-cta__panel > a:hover {
  background: #fff;
  transform: translateY(-2px);
}

@media (max-width: 940px) {
  .legal-hero__grid,
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal-meta > div + div {
    border-left: 1px solid var(--legal-line);
    padding-left: 22px;
  }

  .legal-sidebar {
    gap: 18px;
    position: static;
  }

  .legal-toc ol {
    column-count: 2;
    column-gap: 28px;
    display: block;
  }

  .legal-toc li {
    break-inside: avoid;
  }

  .legal-contact {
    max-width: 440px;
  }

  .legal-document {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .legal-hero {
    padding-block: calc(var(--header-h, 66px) + 42px) 68px;
  }

  .legal-breadcrumb {
    margin-bottom: 39px;
  }

  .legal-hero h1 {
    font-size: clamp(3.05rem, 15vw, 4.45rem);
  }

  .legal-meta,
  .legal-cta__panel {
    grid-template-columns: 1fr;
  }

  .legal-meta > div + div {
    border-left: 0;
    padding-left: 0;
  }

  .legal-toc ol {
    column-count: 1;
  }

  .legal-content {
    padding-block: 56px 68px;
  }

  .legal-document > section {
    padding-block: 32px;
  }

  .legal-cta__panel > a {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.page-legal {
    scroll-behavior: auto;
  }

  .legal-toc a,
  .legal-related a,
  .legal-cta__panel > a {
    transition: none;
  }

  .legal-toc a:hover,
  .legal-cta__panel > a:hover {
    transform: none;
  }
}

@media (forced-colors: active) {
  .legal-page :where(.legal-meta, .legal-toc, .legal-document > section, .legal-related, .legal-cta__panel) {
    border-color: CanvasText;
  }

  .legal-page :where(.legal-contact, .legal-document__notice, .legal-related a, .legal-cta__panel > a) {
    background: Canvas;
    border: 1px solid CanvasText;
    color: CanvasText;
  }
}

@media print {
  html.page-legal .site-header,
  html.page-legal .footer,
  .legal-sidebar,
  .legal-cta {
    display: none !important;
  }

  .legal-page,
  .legal-hero,
  .legal-content {
    background: #fff !important;
    color: #000 !important;
  }

  .legal-hero {
    padding-top: 28px;
  }

  .legal-layout {
    display: block;
  }

  .legal-document > section,
  .legal-document__notice {
    break-inside: avoid;
  }

  .legal-page :where(.legal-hero__lead, .legal-richtext, .legal-document__notice > p:last-child) {
    color: #222 !important;
  }
}
