/* ============================================================
   OMNIFITT — LEGAL PAGES (Privacy / Terms)
   ============================================================ */

.page-legal {
  background: var(--off-white);
}

.legal-page {
  color: var(--pine);
  background:
    radial-gradient(circle at 12% 8%, #ddf96a33, transparent 28%),
    radial-gradient(circle at 88% 18%, #c9c4ff40, transparent 30%),
    linear-gradient(180deg, #fafbf7 0%, #f2f6ea 42%, #ebe8f6 78%, #184d38 100%);
  /* overflow must stay visible so the left TOC can position: sticky */
  overflow: visible;
}

/* Hero */
.legal-hero {
  position: relative;
  padding: 140px 5vw 56px;
  overflow: hidden;
}

.legal-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 30%, #ddf96a2e, transparent 34%),
    radial-gradient(circle at 82% 20%, #c9c4ff36, transparent 32%),
    linear-gradient(165deg, #fafbf7 0%, #f0f5e8 55%, #e8e5f6 100%);
}

.legal-hero-bg::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #174d3b26, transparent);
}

.legal-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
}

.legal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 22px;
  color: #658076;
  font-family: var(--font-kicker);
  font-size: var(--kicker-size);
  font-weight: var(--kicker-weight);
  letter-spacing: var(--kicker-tracking);
  text-transform: uppercase;
}

.legal-kicker i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 5px #ddf96a22;
}

.legal-hero h1 {
  margin: 0 0 18px;
  color: var(--pine-night);
  font-family: var(--font-geist), sans-serif;
  font-size: clamp(3rem, 7vw, 5.4rem);
  font-weight: 750;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.legal-hero h1 em {
  font-style: italic;
  font-weight: 650;
  color: var(--hunter);
}

.legal-lede {
  max-width: 560px;
  margin: 0 0 28px;
  color: #4d665c;
  font-size: 17px;
  line-height: 1.65;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-bottom: 28px;
  color: #6b7e75;
  font-size: 13px;
  line-height: 1.5;
}

.legal-meta strong {
  margin-right: 6px;
  color: var(--pine);
  font-weight: 650;
}

.legal-switch {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  background: #ffffffb8;
  border: 1px solid #174d3b1f;
  border-radius: 999px;
  box-shadow: 0 10px 30px #174d3b0f;
}

.legal-switch a {
  padding: 10px 18px;
  border-radius: 999px;
  color: #5d746a;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.legal-switch a:hover {
  color: var(--pine);
  background: #174d3b0d;
}

.legal-switch a.is-active {
  color: #f7faef;
  background: var(--hunter);
}

/* Body layout */
.legal-body {
  position: relative;
  padding: 10px 5vw 120px;
}

.legal-body::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 160px;
  pointer-events: none;
  background: linear-gradient(180deg, #184d3800 0%, #174d3bb0 48%, #184d38 100%);
}

.legal-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 248px minmax(0, 760px);
  gap: 40px;
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
}

.legal-toc {
  position: sticky;
  top: 104px;
  z-index: 5;
  align-self: start;
  width: 100%;
  max-height: calc(100vh - 124px);
  display: flex;
  flex-direction: column;
  padding: 16px 12px 14px;
  background: #fffffff0;
  border: 1px solid #174d3b16;
  border-radius: 18px;
  box-shadow: 0 16px 40px #174d3b0f;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.legal-toc > span {
  display: block;
  flex: 0 0 auto;
  margin-bottom: 12px;
  padding: 0 6px;
  color: #7a8f85;
  font-family: var(--font-kicker);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.legal-toc ol {
  list-style: none;
  margin: 0;
  padding: 0 2px 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #174d3b33 transparent;
}

.legal-toc ol::-webkit-scrollbar {
  width: 4px;
}

.legal-toc ol::-webkit-scrollbar-thumb {
  background: #174d3b33;
  border-radius: 4px;
}

.legal-toc li + li {
  margin-top: 2px;
}

.legal-toc a {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #5d746a;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.35;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.legal-toc a span {
  flex: 0 0 auto;
  color: #9aaba3;
  font-variant-numeric: tabular-nums;
}

.legal-toc a:hover {
  color: var(--pine);
  background: #174d3b0a;
}

.legal-toc a.is-active {
  color: var(--pine-night);
  background: #184d3810;
  border-left-color: var(--hunter);
  font-weight: 650;
}

.legal-toc a.is-active span {
  color: var(--hunter);
}

.legal-article {
  background: #fffffff2;
  border: 1px solid #174d3b1a;
  border-radius: 28px;
  padding: 42px 44px 48px;
  box-shadow: 0 28px 70px #174d3b14;
}

.legal-intro {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid #174d3b14;
}

.legal-intro p,
.legal-section p,
.legal-disclaimer p,
.legal-contact p,
.legal-crosslink {
  color: #3f564d;
  font-size: 15px;
  line-height: 1.72;
}

.legal-intro p + p,
.legal-section p + p,
.legal-section p + ul,
.legal-section ul + p,
.legal-section h3 + p,
.legal-section p + h3,
.legal-section p + .legal-contact,
.legal-section p + dl {
  margin-top: 14px;
}

.legal-section {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid #174d3b12;
  scroll-margin-top: 110px;
}

.legal-section:first-of-type {
  margin-top: 0;
}

.legal-section h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--pine-night);
  font-family: var(--font-geist), sans-serif;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.legal-num {
  color: #8aa198;
  font-family: var(--font-kicker);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.legal-section h3 {
  margin: 22px 0 10px;
  color: var(--hunter);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.legal-list {
  margin: 12px 0 0;
  padding: 0 0 0 18px;
  color: #3f564d;
}

.legal-list li {
  margin: 6px 0;
  padding-left: 4px;
  font-size: 15px;
  line-height: 1.55;
}

.legal-list li::marker {
  color: var(--hunter);
}

.legal-defs {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.legal-defs > div {
  padding: 14px 16px;
  background: #f6f8f2;
  border: 1px solid #174d3b12;
  border-radius: 14px;
}

.legal-defs dt {
  margin-bottom: 4px;
  color: var(--pine-night);
  font-size: 13px;
  font-weight: 750;
}

.legal-defs dd {
  margin: 0;
  color: #4d665c;
  font-size: 14px;
  line-height: 1.55;
}

.legal-contact {
  margin-top: 16px;
  padding: 20px 22px;
  background: linear-gradient(145deg, #f4f8ec, #f3f1fb);
  border: 1px solid #174d3b18;
  border-radius: 18px;
}

.legal-contact strong {
  display: block;
  margin-bottom: 10px;
  color: var(--pine-night);
  font-size: 14px;
  font-weight: 750;
}

.legal-contact a {
  color: var(--hunter);
  font-weight: 650;
  text-decoration: none;
}

.legal-contact a:hover {
  text-decoration: underline;
}

.legal-disclaimer {
  margin-top: 40px;
  padding: 22px 24px;
  background: #184d380c;
  border: 1px solid #184d3822;
  border-radius: 18px;
}

.legal-disclaimer-label {
  display: block;
  margin-bottom: 8px;
  color: var(--hunter);
  font-family: var(--font-kicker);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.legal-crosslink {
  margin-top: 28px;
}

.legal-crosslink a,
.legal-intro a {
  color: var(--hunter);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Footer legal links (sitewide via style.css snippet below if needed) */
.footer-legal-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
}

.footer-legal-links a:hover {
  color: var(--lime);
}

@media (max-width: 960px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .legal-toc {
    position: static;
    width: auto;
    max-height: none;
    padding: 16px 14px;
  }

  .legal-toc ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 10px;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .legal-hero {
    padding: 118px 20px 40px;
  }

  .legal-hero h1 {
    font-size: 48px;
  }

  .legal-lede {
    font-size: 16px;
  }

  .legal-body {
    padding: 0 20px 100px;
  }

  .legal-article {
    padding: 28px 22px 34px;
    border-radius: 22px;
  }

  .legal-toc ol {
    grid-template-columns: 1fr;
  }

  .legal-switch {
    width: 100%;
  }

  .legal-switch a {
    flex: 1;
    text-align: center;
  }
}
