/* Playflow legal documents. Layers on site.css + docs.css.
   Load order: site.css, docs.css, legal.css.

   Legal pages reuse the docs shell (sidebar, sticky TOC, .prose) because they
   are the same reading problem: long structured text that people arrive at
   mid-document from a link. What differs is numbering, definitions, and the
   need to print cleanly, so that is all this file adds.

   Specificity note: every override is written `.prose.legal-body x` (0,2,1) so
   it beats `.prose x` (0,1,1) regardless of stylesheet load order. */

/* ---------- shell ---------- */
.legal { display: grid; grid-template-columns: 220px minmax(0,1fr) 200px; gap: 48px; align-items: start;
  max-width: var(--max); margin: 0 auto; padding: 40px var(--pad) 96px; }

/* ---------- document header ---------- */
.legal-head { display: flex; flex-direction: column; gap: 14px; padding-bottom: 26px;
  border-bottom: 1px solid var(--driftwood); }
.legal-print { align-self: flex-start; }
.legal-head h1 { font-family: var(--font-display); font-size: 40px; line-height: 1.08;
  letter-spacing: -.025em; font-weight: 700; margin: 0; text-wrap: balance; }
.legal-dates { display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--font-mono);
  font-size: 12px; color: var(--slate-teal); }
.legal-dates > span { white-space: nowrap; }
.legal-dates b { color: var(--ink); font-weight: 600; }

/* ---------- plain-English summary ----------
   Not a substitute for the terms, and says so. It exists because the
   product voice is plain language and a wall of clauses contradicts that. */
.legal-summary { background: var(--shell); border: 1px solid var(--driftwood);
  border-left: 3px solid var(--seafoam); border-radius: var(--r-lg); padding: 20px 22px;
  display: flex; flex-direction: column; gap: 12px; }
.prose.legal-body .legal-summary h2 { font-family: var(--font-mono); font-size: 11px; margin-top: 0; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--deep-teal); margin: 0; }
.legal-summary ul { list-style: none; margin: 0; padding: 0; display: flex;
  flex-direction: column; gap: 9px; }
.legal-summary li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px;
  line-height: 1.55; }
.legal-summary .i { width: 15px; height: 15px; flex: none; margin-top: 4px; color: var(--deep-teal); }
.legal-summary .caption { color: var(--slate-teal); font-size: 12.5px; }

/* ---------- clause numbering ----------
   docs.css styles `ol > li` with a circled step badge, which is right for a
   3-step tutorial and wrong for 40 legal clauses. Reset to legal convention:
   decimal at the top level, dotted decimal when nested (4.2, 4.2.1). */
.prose.legal-body ol { counter-reset: clause; list-style: none; padding-left: 0;
  display: flex; flex-direction: column; gap: 14px; }
.prose.legal-body ol > li { counter-increment: clause; position: relative;
  padding-left: 42px; }
.prose.legal-body ol > li::before { content: counters(clause,".");
  position: absolute; left: 0; top: 0; width: auto; height: auto; min-width: 34px;
  border-radius: 0; background: none; color: var(--slate-teal);
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  display: block; text-align: left; }
.prose.legal-body ol ol { margin-top: 12px; gap: 10px; }
.prose.legal-body ol ol > li { padding-left: 48px; }
.prose.legal-body ol ol > li::before { min-width: 42px; font-size: 12.5px; }
.prose.legal-body ul { padding-left: 22px; gap: 8px; }
.prose.legal-body ul > li { padding-left: 0; }
.prose.legal-body ul > li::before { content: none; }

/* Numbered section headings carry the same mono prefix as the clauses. */
.prose.legal-body > h2 { font-size: 22px; margin-top: 52px;
  display: flex; gap: 12px; align-items: baseline; }
.prose.legal-body > h2 .num { font-family: var(--font-mono); font-size: 15px; font-weight: 600;
  color: var(--deep-teal); flex: none; }
.prose.legal-body h3 { margin-top: 28px; }
.prose.legal-body > p:first-of-type { font-size: 16px; color: var(--ink); }

/* ---------- definitions ---------- */
.legal-defs { display: grid; gap: 0; border: 1px solid var(--driftwood);
  border-radius: var(--r-lg); overflow: hidden; background: var(--shell); margin: 0; }
.legal-defs > div { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 18px;
  padding: 13px 16px; border-bottom: 1px solid var(--driftwood); }
.legal-defs > div:last-child { border-bottom: none; }
.legal-defs dt { font-weight: 700; font-size: 14.5px; }
.legal-defs dd { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--slate-teal); }

/* ---------- contact / closing block ---------- */
.legal-contact { margin-top: 52px; padding: 22px 24px; border-radius: var(--r-lg);
  background: var(--teal-tint); display: flex; flex-direction: column; gap: 8px; }
.prose.legal-body .legal-contact h2 { font-family: var(--font-display); font-size: 20px;
  font-weight: 700; letter-spacing: -.015em; margin: 0; display: block; }

.legal-contact p { margin: 0; font-size: 15px; line-height: 1.6; }
.legal-contact address { font-style: normal; font-family: var(--font-mono); font-size: 13px;
  line-height: 1.7; color: var(--slate-teal); }

/* ---------- change history ---------- */
.legal-history { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px;
  border: 1px solid var(--driftwood); border-radius: var(--r-lg); overflow: hidden;
  background: var(--shell); }
.legal-history th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--slate-teal); padding: 10px 14px;
  background: rgba(27,47,56,.03); border-bottom: 1px solid var(--driftwood); white-space: nowrap; }
.legal-history td { padding: 11px 14px; border-bottom: 1px solid var(--driftwood);
  vertical-align: top; line-height: 1.55; }
.legal-history tr:last-child td { border-bottom: none; }
.legal-history td:first-child { font-family: var(--font-mono); font-size: 12.5px;
  color: var(--slate-teal); white-space: nowrap; }

/* ---------- sidebar: the document set ---------- */
.legal-nav { position: sticky; top: calc(var(--docs-header) + var(--docs-gap));
  display: flex; flex-direction: column; gap: 2px; }
.legal-nav h2 { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--slate-teal); margin: 0 0 10px; }
.legal-nav > a, .legal-nav > span.soon { display: block; padding: 8px 12px; border-radius: var(--r-md);
  font-size: 14px; color: var(--ink); text-decoration: none; line-height: 1.35; }
.legal-nav > a:hover { background: var(--dune); text-decoration: none; }
.legal-nav > a[aria-current="page"] { background: var(--teal-tint); color: var(--deep-teal);
  font-weight: 600; }
.legal-nav > span.soon { color: var(--slate-teal); cursor: default; }
.legal-nav > span.soon::after { content: "soon"; margin-left: 8px; font-family: var(--font-mono);
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: var(--dune); border-radius: 3px; padding: 1px 5px; }
.legal-nav .legal-nav__foot { margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--driftwood); font-size: 13px; color: var(--slate-teal);
  line-height: 1.55; }

/* ---------- print ----------
   People print and sign these, so the page has to survive it: no chrome, no
   dark grounds burning ink, and URLs spelled out since a paper link is dead. */
@media print {
  .site-header, .site-footer, .legal-nav, .docs-toc, .skip, .legal-print { display: none !important; }
  .legal { display: block; padding: 0; max-width: none; }
  .prose, .prose.legal-body { max-width: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .legal-summary, .legal-contact, .legal-defs, .legal-history {
    background: none; border: 1px solid #999; }
  .legal-contact { background: none; }
  .prose.legal-body h2 { margin-top: 22pt; page-break-after: avoid; }
  .prose.legal-body h2 .num { color: #000; }
  .prose.legal-body li, .prose.legal-body p { page-break-inside: avoid; }
  .prose a::after { content: " (" attr(href) ")"; font-family: var(--font-mono); font-size: 9pt;
    color: #444; word-break: break-all; }
  .prose a[href^="#"]::after { content: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .legal { grid-template-columns: 220px minmax(0,1fr); }
  .legal .docs-toc { display: none; }
}
@media (max-width: 900px) {
  .legal { grid-template-columns: minmax(0,1fr); gap: 28px; padding: 28px 20px 72px; }
  .legal-nav { position: static; border: 1px solid var(--driftwood); border-radius: var(--r-lg);
    padding: 16px; background: var(--shell); }
  .legal-head h1 { font-size: 32px; }
  .legal-defs > div { grid-template-columns: minmax(0,1fr); gap: 4px; }
}
@media (max-width: 560px) {
  .prose.legal-body ol > li, .prose.legal-body ol ol > li { padding-left: 34px; }
  .prose.legal-body ol > li::before, .prose.legal-body ol ol > li::before { min-width: 30px; font-size: 12px; }
}
