/* ===================================================================
   POLICY PAGES — Privacy Policy and Terms of Use
   Loaded alongside landing.css, which supplies the reset, the body
   background, the --font-sans / colour tokens, the nav and the footer.
   Everything here is namespaced .policy-* so it cannot collide with
   the landing page's own classes.
   =================================================================== */

.policy-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 40px 88px;
}

/* ---- Page header ---- */
.policy-header {
  max-width: 820px;
  margin: 0 auto 36px;
  text-align: center;
}

.policy-eyebrow {
  display: inline-block;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.policy-header h1 {
  font-size: clamp(30px, 3.4vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.policy-dates {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ---- Two-column shell: sticky contents + the document ---- */
.policy-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 32px;
  align-items: start;
}

/* ---- Table of contents ---- */
.policy-toc {
  position: sticky;
  top: 96px;              /* clears the sticky nav */
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 18px;
}

.policy-toc-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.policy-toc ol {
  list-style: none;
  counter-reset: toc;
}

.policy-toc li { margin-bottom: 2px; }

.policy-toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.policy-toc a:hover {
  background: rgba(112, 145, 230, 0.12);
  color: var(--primary-dark);
}

.policy-toc a.current {
  background: var(--primary-dark);
  color: #fff;
}

/* ---- The document itself ---- */
.policy-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 44px 48px;
  box-shadow: 0 8px 30px rgba(61, 82, 160, 0.12);
  /* Legal prose reads badly at full width. */
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text-muted);
}

.policy-card > h1 {
  /* The visible page title lives in .policy-header; the h1 that comes
     with the document body is kept for document structure but hidden. */
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.policy-card h2 {
  margin: 38px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.3;
  color: var(--text-dark);
  scroll-margin-top: 96px;   /* so anchors clear the sticky nav */
}

.policy-card h2:first-of-type {
  margin-top: 26px;
}

.policy-card h3 {
  margin: 26px 0 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  scroll-margin-top: 96px;
}

.policy-card h4 {
  margin: 20px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
}

.policy-card p { margin-bottom: 14px; }

.policy-card ul {
  margin: 0 0 16px;
  padding-left: 22px;
}

.policy-card li { margin-bottom: 8px; }

.policy-card li::marker { color: var(--primary-medium); }

.policy-card strong { color: var(--text-dark); font-weight: 700; }

.policy-card a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.policy-card a:hover { color: var(--primary-medium); }

/* The intro block above the first h2 */
.policy-card > p:first-of-type { font-size: 16px; }

/* ---- Back to top ---- */
.policy-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--primary-dark);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 6px 20px rgba(61, 82, 160, 0.35);
  transition: opacity 0.25s, visibility 0.25s, transform 0.2s;
}

.policy-top.show { opacity: 1; visibility: visible; }
.policy-top:hover { transform: translateY(-2px); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .policy-shell { grid-template-columns: 1fr; }

  /* Contents becomes a collapsed disclosure above the document. */
  .policy-toc {
    position: static;
    max-height: none;
    padding: 0;
    overflow: visible;
  }

  .policy-toc summary {
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
    cursor: pointer;
    list-style: none;
  }

  .policy-toc summary::-webkit-details-marker { display: none; }

  .policy-toc summary::after {
    content: '▾';
    float: right;
    font-size: 12px;
  }

  .policy-toc[open] summary::after { content: '▴'; }

  .policy-toc ol { padding: 0 12px 14px; }
}

@media (max-width: 768px) {
  .policy-main { padding: 32px 16px 64px; }
  .policy-card { padding: 28px 22px; border-radius: 16px; font-size: 15px; }
  .policy-card h2 { font-size: 19px; margin-top: 30px; }
  .policy-card h3 { font-size: 16px; }
  .policy-top { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .policy-top { transition: none; }
  .policy-card h2, .policy-card h3 { scroll-margin-top: 0; }
}