/* PepPin legal pages. Loaded after styles.css, so the landing page's tokens,
   fonts, nav, theme toggle and footer apply unchanged. */
body.legal { background: var(--bg); color: var(--ink); }
.legal .nav { top: 16px; }
.legal .nav__pill { box-shadow: 0 10px 30px -20px var(--shadow-soft); }
/* dark theme: the landing page's dark nav, set by the theme instead of by scroll */
:root[data-theme="dark"] .legal .nav {
  --nav-ink: var(--on-dark);
  --nav-pill: oklch(0.22 0.008 165 / .72);
  --nav-line: oklch(1 0 0 / .1);
  --nav-cta-bg: var(--on-dark);
  --nav-cta-ink: var(--ink-fixed);
}
/* a soft fade under the floating nav, so text never runs behind it */
body.legal::before {
  content: ""; position: fixed; z-index: calc(var(--z-nav) - 1); top: 0; left: 0; right: 0; height: 100px;
  background: linear-gradient(var(--bg) 58%, color-mix(in oklch, var(--bg) 0%, transparent));
  pointer-events: none;
}

.legal-main { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.legal-main :focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 4px; }

/* hero */
.legal-hero { padding-top: clamp(128px, 18vh, 176px); }
.legal-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-ink); }
.legal-hero h1 { margin-top: 18px; font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.2rem); font-weight: 600; line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance; }
.legal-meta { margin-top: 18px; font-size: 15px; color: var(--ink-3); }

/* tabs */
.legal-tabs {
  display: flex; gap: clamp(22px, 3.2vw, 44px); margin-top: clamp(40px, 6vh, 64px);
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
}
.legal-tabs::-webkit-scrollbar { display: none; }
.legal-tabs a { position: relative; flex: none; padding: 0 0 18px; font-size: 16.5px; color: var(--ink-2); transition: color .3s; }
.legal-tabs a:hover { color: var(--ink); }
.legal-tabs a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.legal-tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }

/* layout */
.legal-grid { display: grid; grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); gap: clamp(40px, 6vw, 88px); padding: 56px 0 clamp(96px, 14vh, 160px); }
.legal-side { position: sticky; top: 108px; align-self: start; max-height: calc(100vh - 128px); overflow: auto; scrollbar-width: none; }
.legal-side::-webkit-scrollbar { display: none; }
.legal-label { font-size: 12.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); list-style: none; }
.legal-label::-webkit-details-marker { display: none; }
.legal-toc summary { cursor: default; pointer-events: none; }
.legal-toc ol { margin-top: 20px; }
.legal-toc a {
  display: flex; gap: 16px; padding: 9px 0 9px 18px; border-left: 2px solid var(--line);
  font-size: 14.5px; line-height: 1.4; color: var(--ink-3); transition: color .3s, border-color .3s;
}
.legal-toc a span { flex: none; width: 18px; font-size: 12.5px; padding-top: 1px; color: var(--ink-3); font-variant-numeric: tabular-nums; opacity: .8; }
.legal-toc a:hover { color: var(--ink); }
.legal-toc a[aria-current="location"] { border-left-color: var(--accent-ink); color: var(--ink); }
.legal-toc a[aria-current="location"] span { color: var(--accent-ink); opacity: 1; }
.legal-ask { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--ink-2); }
.legal-ask a { display: inline-block; margin-top: 6px; color: var(--accent-ink); font-weight: 500; }
.legal-ask a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* the document */
.legal-body { max-width: 760px; font-size: 17px; line-height: 1.72; color: var(--ink-2); }
.legal-body h2 {
  margin: 56px 0 16px; padding-top: 28px; border-top: 1px solid var(--line);
  font-size: clamp(1.35rem, 1.15rem + .7vw, 1.7rem); font-weight: 600; line-height: 1.25; letter-spacing: -0.02em;
  color: var(--ink); scroll-margin-top: 108px;
}
.legal-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-body p { margin: 0 0 16px; text-wrap: pretty; }
.legal-body strong { color: var(--ink); font-weight: 600; }
.legal-body ul, .legal-body ol { margin: 0 0 18px; padding-left: 1.3em; list-style: disc; }
.legal-body li { margin: 0 0 8px; }
.legal-body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.legal-body a:hover { text-decoration-color: var(--accent-ink); }

/* footer: the landing page's closing band */
.legal-footband { background: var(--graphite); color: var(--on-dark); padding: 0 var(--gutter) 44px; }
.legal-footband .footer { margin-top: 0; padding-top: 40px; border-top: 0; }

@media (max-width: 900px) {
  .legal-hero { padding-top: 112px; }
  .legal-grid { grid-template-columns: 1fr; gap: 32px; padding-top: 36px; }
  .legal-side { position: static; max-height: none; overflow: visible; }
  .legal-toc details { padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); }
  .legal-toc summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; pointer-events: auto; }
  .legal-toc summary::after { content: "+"; font-size: 18px; font-weight: 400; letter-spacing: 0; color: var(--ink-3); }
  .legal-toc details[open] summary::after { content: "−"; }
  .legal-toc ol { margin-top: 14px; }
  .legal-ask { margin-top: 20px; padding-top: 0; border-top: 0; }
  .legal-tabs { gap: 18px; }
  .legal-tabs a { font-size: 15px; padding-bottom: 14px; }
  .legal-body { font-size: 16.5px; }
  .legal-body h2 { margin-top: 44px; padding-top: 24px; }
}

/* touch: every link and control at least 44px tall */
@media (pointer: coarse), (max-width: 767px) {
  .legal .nav__cta--solo { height: 44px; }
  .legal-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding-top: 6px; }
  .legal-toc a { padding-block: 12px; }
  .legal-toc summary { min-height: 44px; }
  .legal-toc details { padding-block: 8px; }
  .legal-ask a { display: inline-flex; align-items: center; min-height: 44px; margin-top: 0; }
  .footer nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
  .footer nav { gap: 0 26px; }
}
