/* Legal pages (tos.html, privacy.html), written by tools/pages/build.mjs. Every rule is
   scoped to .legal-*; the chrome is the site's own. Palette as about-v4.css: ink #1a1b26,
   dark #12131b, yellow #f7e463, light #fff. Type sizes match consistency.css. */

.legal { color: #ffffff; }
.site-dark .legal .header-cta { background: var(--yellow); color: var(--ink); }
.site-dark .legal .header-cta:hover,
.site-dark .legal .header-cta:focus-visible { background: #ffe14f; color: var(--ink); transform: none; }

/* Hero: title and particulars beside the document's own summary */
.legal-hero { padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(3rem, 6vw, 5.5rem); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.legal-hero h1 { max-width: 14ch; margin: 0 0 1.75rem; font-size: clamp(2.25rem, 4.6vw, 4.4rem); line-height: 1.02; letter-spacing: -.055em; font-weight: 620; text-wrap: balance; }
.legal-meta { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, max-content)); gap: 1.1rem 2.5rem; }
.legal-meta div { display: grid; gap: .3rem; }
.legal-meta dt { color: #b9b8c4; font-size: .8125rem; }
.legal-meta dd { margin: 0; color: #ffffff; font-size: 1rem; font-weight: 620; letter-spacing: -.01em; }
.legal-meta a, .legal-companion a { color: #ffffff; text-decoration: underline; text-underline-offset: .22em; text-decoration-color: var(--yellow); }
.legal-meta a:hover, .legal-meta a:focus-visible,
.legal-companion a:hover, .legal-companion a:focus-visible { color: var(--yellow); }
.legal-companion { max-width: 36rem; margin: 1.75rem 0 0; color: #d2d1dc; font-size: 1.0625rem; line-height: 1.55; }

.legal-glance { padding: clamp(1.5rem, 3vw, 2.25rem); border: 1px solid rgba(255,255,255,.14); border-radius: 22px; background: #1a1b26; }
.legal-glance h2 { margin: 0 0 1.1rem; font-size: 1.25rem; line-height: 1.2; letter-spacing: -.025em; font-weight: 620; }
.legal-glance ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .9rem; }
.legal-glance li { position: relative; padding-left: 1.4rem; color: #d2d1dc; font-size: 1rem; line-height: 1.5; text-wrap: pretty; }
.legal-glance li::before { content: ""; position: absolute; left: 0; top: .55em; width: .5rem; height: .5rem; border-radius: 50%; background: var(--yellow); }

/* Document: a contents rail beside the text on wide screens */
.legal-doc { padding: clamp(3rem, 7vw, 6rem) 0; background: #ffffff; color: var(--ink); }
.legal-grid { display: grid; grid-template-columns: 15rem minmax(0, 68ch); gap: clamp(2.5rem, 6vw, 6rem); }
.legal-toc { position: sticky; top: 1.5rem; align-self: start; }
.legal-toc summary { list-style: none; pointer-events: none; margin: 0 0 .9rem; color: var(--muted); font-size: .75rem; font-weight: 650; letter-spacing: .13em; text-transform: uppercase; }
.legal-toc summary::-webkit-details-marker { display: none; }
.legal-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.legal-toc a { color: #3d3e4c; font-size: .9375rem; line-height: 1.35; text-decoration: none; }
.legal-toc a:hover, .legal-toc a:focus-visible { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; }
.legal-section { scroll-margin-top: 1.5rem; }
.legal-section + .legal-section { margin-top: 2.75rem; }
.legal-body h2 { margin: 0 0 1rem; font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.12; letter-spacing: -.035em; font-weight: 620; text-wrap: balance; }
.legal-body p { margin: 0 0 1rem; color: #2f3040; font-size: 1.0625rem; line-height: 1.6; text-wrap: pretty; }
.legal-body strong { color: var(--ink); font-weight: 650; }
.legal-body ul { margin: 0 0 1rem; padding-left: 1.3rem; display: grid; gap: .55rem; }
.legal-body li { color: #2f3040; font-size: 1.0625rem; line-height: 1.55; text-wrap: pretty; }
.legal-body li::marker { color: var(--muted); }
.legal-body a { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; }
.legal-body a:hover, .legal-body a:focus-visible { text-decoration-color: var(--yellow); }

@media (max-width: 1000px) {
  .legal-hero { grid-template-columns: 1fr; gap: 2.25rem; }
  .legal-grid { grid-template-columns: 1fr; gap: 2.25rem; }
  /* The contents list becomes a toggle; site-interactions.js closes it on load at this width */
  .legal-toc { position: static; padding: .9rem 1.15rem; border: 1px solid var(--line); border-radius: 16px; }
  .legal-toc summary { pointer-events: auto; cursor: pointer; margin: 0; display: flex; align-items: center; justify-content: space-between; }
  .legal-toc summary::after { content: ""; width: .55rem; height: .55rem; margin-right: .2rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 160ms ease; }
  .legal-toc details[open] summary { margin-bottom: .9rem; }
  .legal-toc details[open] summary::after { transform: rotate(-135deg); }
}
@media (max-width: 700px) {
  .legal-hero h1 { max-width: none; }
  .legal-meta { grid-template-columns: 1fr; gap: .9rem; }
}
@media (prefers-reduced-motion: reduce) { .legal-toc summary::after { transition: none; } }
@media print {
  .site-header, .site-footer, .consent-banner, .legal-toc, .legal-companion { display: none !important; }
  body.site-dark, .legal, .legal-doc { background: #fff; color: #000; }
  .legal-glance { border-color: #999; background: none; }
  .legal-glance li, .legal-meta dt, .legal-meta dd, .legal-body p, .legal-body li { color: #000; }
}
