/* PeduliAI legal and policy pages: a shared, reading-first subpage system. */
.legal-page {
  background: var(--brand-cloud);
  color: var(--brand-ink);
}

.legal-page ::selection {
  background: rgba(8, 145, 178, .24);
  color: #082f49;
}

.legal-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(560px, 72vh, 760px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
  background: var(--brand-navy);
}

.legal-hero-media,
.legal-hero-media img,
.legal-hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.legal-hero-media { z-index: -3; }
.legal-hero-media img {
  object-fit: cover;
  object-position: center;
}

.legal-hero-shade {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(2, 10, 28, .96) 0%, rgba(2, 10, 28, .82) 34%, rgba(2, 10, 28, .3) 68%, rgba(2, 10, 28, .12) 100%),
    linear-gradient(180deg, rgba(2, 10, 28, .12) 52%, rgba(2, 10, 28, .88) 100%);
}

.legal-hero-content {
  padding-top: calc(var(--site-header-height, 72px) + 72px);
  padding-bottom: clamp(72px, 9vw, 112px);
}

.legal-hero h1 {
  max-width: 12ch;
  margin: 0;
  color: #fff;
  font-family: var(--font-display, Lexend, sans-serif);
  font-size: clamp(3rem, 6.2vw, 5.8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.legal-content {
  padding: clamp(72px, 9vw, 120px) 0;
  background: var(--brand-cloud);
}

/* Legal copy must never inherit the dark transition canvas while it is
   entering the viewport; keep the reading surface consistently light. */
html.bg-choreography-ready .legal-page .legal-content {
  background: var(--brand-cloud) !important;
}

.legal-shell {
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(0, 1fr);
  gap: clamp(48px, 8vw, 112px);
  align-items: start;
}

.legal-doc-nav {
  position: sticky;
  top: calc(var(--site-header-height, 72px) + 28px);
  display: grid;
  border-top: 1px solid var(--brand-line);
}

.legal-doc-nav a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--brand-line);
  color: var(--brand-muted);
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: color 160ms ease, padding-left 180ms var(--brand-ease);
}

.legal-doc-nav a:hover {
  padding-left: 8px;
  color: var(--brand-ink);
}

.legal-doc-nav a[aria-current="page"] {
  color: var(--brand-dark);
  font-weight: 700;
}

.legal-reading {
  width: 100%;
  max-width: 68ch;
  margin: 0;
}

.legal-reading > :first-child { margin-top: 0; }
.legal-reading p,
.legal-reading li {
  color: var(--brand-muted);
  font-size: clamp(1.05rem, 1.25vw, 1.14rem);
  line-height: 1.8;
}

.legal-reading > p:first-child {
  color: var(--ink-secondary);
  font-size: clamp(1.2rem, 2vw, 1.48rem);
  line-height: 1.65;
}

.legal-reading p + p { margin-top: 1.5rem; }
.legal-reading h2 {
  margin: clamp(52px, 7vw, 76px) 0 18px;
  color: var(--brand-ink);
  font-family: var(--font-display, Lexend, sans-serif);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.16;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.legal-reading .feature-list {
  display: grid;
  gap: 0;
  margin-top: 8px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--brand-line);
}

.legal-reading .feature-list li {
  position: relative;
  padding: 22px 0 22px 30px;
  border-bottom: 1px solid var(--brand-line);
}

.legal-reading .feature-list li::before {
  content: '';
  position: absolute;
  top: 31px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-cyan);
  box-shadow: 0 0 0 5px rgba(8, 145, 178, .1);
}

@media (max-width: 760px) {
  .legal-hero { min-height: 590px; }
  .legal-hero-media img { object-position: 66% center; }
  .legal-hero-shade {
    background:
      linear-gradient(180deg, rgba(2, 10, 28, .2) 12%, rgba(2, 10, 28, .55) 50%, rgba(2, 10, 28, .96) 100%),
      linear-gradient(90deg, rgba(2, 10, 28, .58), rgba(2, 10, 28, .08));
  }
  .legal-hero-content { padding-bottom: 58px; }
  .legal-hero h1 { max-width: 10ch; font-size: clamp(2.65rem, 13vw, 4.25rem); }
  .legal-content { padding-block: 64px 76px; }
  .legal-shell { grid-template-columns: 1fr; gap: 48px; }
  .legal-doc-nav { position: static; top: auto; }
  .legal-reading { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .legal-doc-nav a { transition: none; }
}
