/*
 * LyfPath legal pages
 * -------------------
 * Chrome and prose styling for terms.html and privacy.html. Built on the same
 * fonts and page palette as the landing page — Fraunces for display, Hanken
 * Grotesk for text, forest green for structure and gold for accents — so the
 * legal pages read as part of the site rather than a bolted-on document.
 */

:root {
  --lp-ink: #172019;
  --lp-ink-soft: #3D4A40;
  --lp-muted: #56635A;
  --lp-faint: #8D978F;
  --lp-forest: #24462F;
  --lp-green: #3F6548;
  --lp-green-bright: #4C9268;
  --lp-gold: #D9A94F;
  --lp-paper: #FBFCFA;
  --lp-cream: #FAF1DC;
  --lp-line: #E4EAE2;
  --lp-line-soft: #EDF1EB;
  --lp-tint: #F2F7F1;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

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

body {
  margin: 0;
  background: var(--lp-paper);
  color: var(--lp-ink);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--lp-green); text-decoration: none; }
a:hover { color: var(--lp-forest); text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--lp-gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.lp-wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  z-index: 100;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--lp-forest);
  color: #F4F6F2;
  font-size: 14px;
  font-weight: 600;
}
.skip-link:focus { left: 18px; text-decoration: none; }

/* ── Header (matches the landing page) ────────────────────────────────────── */

.lp-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 252, 250, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--lp-line);
}

.lp-head {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.lp-logo { display: flex; align-items: center; height: 100%; }
.lp-logo:hover { text-decoration: none; }

.lp-wordmark {
  display: block;
  transform: translateY(-3px);
  color: var(--lp-forest);
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -.03em;
  line-height: 1;
  white-space: nowrap;
}
.lp-wordmark .lp-y { position: relative; display: inline-block; line-height: 1; }
.lp-wordmark .lp-leaf {
  position: absolute;
  left: .276em;
  top: .217em;
  width: .267em;
  height: .138em;
  overflow: visible;
}
.lp-wordmark .lp-path { color: var(--lp-green-bright); }

.lp-nav { display: flex; align-items: center; gap: 26px; }

.lp-nav a {
  color: var(--lp-ink-soft);
  font-size: 14.5px;
  font-weight: 500;
}
.lp-nav a:hover { color: var(--lp-forest); text-decoration: none; }
.lp-nav a[aria-current="page"] { color: var(--lp-forest); font-weight: 600; }

.lp-nav .lp-cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--lp-forest);
  color: #F4F6F2;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 18px -12px rgba(20, 50, 45, .8);
}
.lp-nav .lp-cta:hover { background: var(--lp-ink); color: #F4F6F2; }

@media (max-width: 900px) {
  .lp-head { padding: 0 20px; gap: 16px; }
  .lp-nav { gap: 16px; }
  .lp-nav a:not(.lp-cta) { display: none; }
  .lp-nav a.lp-legal-switch { display: inline-flex; }
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.legal-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 52px;
  background:
    radial-gradient(900px 480px at 72% -16%, var(--lp-cream) 0%, rgba(250, 241, 220, 0) 62%),
    linear-gradient(var(--lp-paper), var(--lp-tint));
}

.legal-hero::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--lp-gold), rgba(217, 169, 79, 0) 55%);
}

.lp-eyebrow {
  margin: 0 0 16px;
  color: var(--lp-faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.legal-hero h1 {
  margin: 0;
  max-width: 16ch;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.06;
  letter-spacing: -.02em;
}

.legal-hero .lp-lede {
  margin: 20px 0 0;
  max-width: 62ch;
  color: var(--lp-muted);
  font-size: 18px;
  line-height: 1.55;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 30px;
}

.legal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--lp-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: var(--lp-muted);
  font-size: 13px;
}
.legal-meta strong { color: var(--lp-forest); font-weight: 600; }

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

.legal-layout {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 64px;
  align-items: start;
  padding: 56px 28px 96px;
  max-width: 1180px;
  margin: 0 auto;
}

@media (max-width: 960px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 40px 20px 72px; }
}

/* ── Table of contents ────────────────────────────────────────────────────── */

.toc {
  position: sticky;
  top: 102px;
  padding: 22px 20px;
  border: 1px solid var(--lp-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 28px -22px rgba(20, 50, 45, .5);
}

@media (max-width: 960px) {
  .toc { position: static; }
}

.toc h2 {
  margin: 0 0 14px;
  color: var(--lp-faint);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: 1px;
}

.toc a {
  display: block;
  position: relative;
  padding: 8px 10px 8px 34px;
  border-radius: 9px;
  color: var(--lp-muted);
  font-size: 13.5px;
  line-height: 1.35;
}
.toc a::before {
  counter-increment: toc;
  content: counter(toc);
  position: absolute;
  left: 10px;
  top: 8px;
  width: 16px;
  color: var(--lp-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.toc a:hover { background: var(--lp-tint); color: var(--lp-forest); text-decoration: none; }

.toc a.is-current {
  background: var(--lp-forest);
  color: #F4F6F2;
  font-weight: 600;
}
.toc a.is-current::before { color: var(--lp-gold); }

/* ── Prose ────────────────────────────────────────────────────────────────── */

.prose { max-width: 72ch; counter-reset: sec; }

.prose > section { scroll-margin-top: 100px; }
.prose > section + section {
  margin-top: 34px;
  padding-top: 34px;
  border-top: 1px solid var(--lp-line-soft);
}

.prose h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(23px, 2.2vw, 29px);
  line-height: 1.16;
  letter-spacing: -.015em;
}
.prose h2::before {
  counter-increment: sec;
  content: counter(sec);
  flex: none;
  min-width: 30px;
  padding-bottom: 2px;
  border-bottom: 2px solid var(--lp-gold);
  color: var(--lp-faint);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.prose h3 {
  margin: 28px 0 10px;
  color: var(--lp-forest);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.prose p {
  margin: 0 0 15px;
  color: var(--lp-muted);
  font-size: 16px;
  line-height: 1.68;
}
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--lp-ink); font-weight: 600; }

.prose ul {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.prose ul li {
  position: relative;
  padding-left: 26px;
  color: var(--lp-muted);
  font-size: 16px;
  line-height: 1.6;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lp-green-bright);
}

/* ── Key-point callout ────────────────────────────────────────────────────── */

.keypoint {
  margin: 0 0 22px;
  padding: 20px 22px;
  border: 1px solid var(--lp-line);
  border-left: 3px solid var(--lp-gold);
  border-radius: 14px;
  background: linear-gradient(140deg, #FFFDF6, #FBFCFA 70%);
}
.keypoint p { margin: 0; color: var(--lp-ink-soft); font-size: 15.5px; line-height: 1.6; }
.keypoint p + p { margin-top: 10px; }

/* ── Summary grid (privacy "at a glance") ─────────────────────────────────── */

.glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.glance div {
  padding: 18px;
  border: 1px solid var(--lp-line);
  border-radius: 16px;
  background: #fff;
}
.glance strong {
  display: block;
  margin-bottom: 6px;
  color: var(--lp-forest);
  font-size: 14.5px;
  font-weight: 700;
}
.glance span { color: var(--lp-muted); font-size: 14.5px; line-height: 1.55; }

/* ── Tables ───────────────────────────────────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--lp-line);
  border-radius: 16px;
  background: #fff;
}

.prose table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 14.5px;
}

.prose thead th {
  padding: 13px 16px;
  border-bottom: 1px solid var(--lp-line);
  background: var(--lp-tint);
  color: var(--lp-forest);
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.prose tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--lp-line-soft);
  color: var(--lp-muted);
  vertical-align: top;
  line-height: 1.55;
}
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody td:first-child { width: 30%; color: var(--lp-ink); font-weight: 600; }

/* ── Contact card ─────────────────────────────────────────────────────────── */

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 20px 22px;
  border-radius: 18px;
  background: linear-gradient(160deg, #147065, #0C5049);
  color: #F4F6F2;
  box-shadow: 0 18px 34px -24px rgba(12, 72, 67, .9);
}
.contact-card svg { width: 24px; height: 24px; flex: none; }
.contact-card small { display: block; color: rgba(244, 246, 242, .72); font-size: 13px; }
.contact-card strong { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }

.contact-card a {
  margin-left: auto;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(244, 246, 242, .14);
  color: #F4F6F2;
  font-size: 14px;
  font-weight: 600;
}
.contact-card a:hover { background: rgba(244, 246, 242, .24); text-decoration: none; }

/* ── Cross-link to the sibling legal page ─────────────────────────────────── */

.legal-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding: 22px 24px;
  border: 1px solid var(--lp-line);
  border-radius: 18px;
  background: #fff;
}
.legal-next span { color: var(--lp-muted); font-size: 15px; }
.legal-next strong { display: block; color: var(--lp-ink); font-size: 16.5px; font-weight: 600; }

.legal-next a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--lp-forest);
  color: #F4F6F2;
  font-size: 14.5px;
  font-weight: 600;
}
.legal-next a:hover { background: var(--lp-ink); color: #F4F6F2; text-decoration: none; }

/* ── Footer (matches the landing page) ────────────────────────────────────── */

.lp-footer {
  padding: 40px 28px;
  background: var(--lp-ink);
  border-top: 1px solid rgba(244, 246, 242, .1);
}

.lp-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.lp-footer-brand { display: flex; align-items: center; gap: 16px; }
.lp-footer-brand a:hover { text-decoration: none; }

.lp-footer .lp-wordmark {
  transform: none;
  color: #F4F6F2;
  font-size: 24px;
}
.lp-footer .lp-wordmark .lp-path { color: #8CA98A; }

.lp-footer-copy { color: #8B968C; font-size: 13.5px; }

.lp-footer-links { display: flex; gap: 22px; flex-wrap: wrap; }

.lp-footer-links a { color: #B6C4B8; font-size: 13.5px; }
.lp-footer-links a:hover { color: #F4F6F2; text-decoration: underline; text-underline-offset: 3px; }
.lp-footer-links a[aria-current="page"] { color: #F4F6F2; }
