/* legal.css — static /privacy and /terms pages in the Deck language (option A1).
   Server-rendered HTML (no React) so in-app browsers, store reviewers and
   crawlers get the full text. Self-contained: the frozen app tokens (same as
   a1.css .lt / .dt), Bricolage Grotesque + Figtree, flat fills, big radii,
   one ember moment (the title card). Theme: html[data-theme], set before paint. */

:root {
  --bg:#FBFAF7; --card:#F1ECE3; --soft:#E8E1D5; --line:#DCD3C4;
  --ink:#1A1612; --ink2:#554E44; --ink3:#5F584E;
  --acc:#F2701D; --on:#170B03; --acct:#9C4506; --tint:#FBE3D0;
  --fd:'Bricolage Grotesque','Figtree',system-ui,sans-serif;
  --fu:'Figtree',system-ui,-apple-system,'Segoe UI',sans-serif;
  --r:clamp(24px,3vw,40px); --p:clamp(22px,3vw,40px);
}
html[data-theme="dark"] {
  --bg:#0A0908; --card:#1C1A17; --soft:#2A2622; --line:#37322C;
  --ink:#F7F2E8; --ink2:#BFB7A9; --ink3:#A69E90;
  --acc:#FF7A1F; --acct:#FF9A57; --tint:#37241A;
  color-scheme: dark;
}
/* No JS: follow the system. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg:#0A0908; --card:#1C1A17; --soft:#2A2622; --line:#37322C;
    --ink:#F7F2E8; --ink2:#BFB7A9; --ink3:#A69E90;
    --acc:#FF7A1F; --acct:#FF9A57; --tint:#37241A;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.6 var(--fu); -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }

/* Header: brand on the left, a pill back to the site on the right. */
.legal-top {
  max-width: 1240px; margin: 0 auto;
  padding: 18px clamp(16px,4vw,48px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.legal-mark {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none;
  font: 800 22px/1 var(--fd); letter-spacing: -.035em; white-space: nowrap;
}
.legal-mark img { width: 40px; height: 40px; }
.legal-back {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 14px; box-shadow: inset 0 0 0 1.5px var(--line);
  font: 600 15px/1.2 var(--fu); text-decoration: none;
}
.legal-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.legal-back:hover { background: var(--card); }

/* Document column */
.legal-doc { padding: 0 clamp(16px,4vw,48px) clamp(40px,6vw,80px); }
.legal-doc article { max-width: 820px; margin: 0 auto; }
.wrap-narrow { max-width: 820px; margin: 0 auto; }

/* Title card: the page's one ember moment. */
.legal-hero {
  border-radius: var(--r); padding: var(--p); background: var(--acc); color: var(--on);
}
.legal-hero h1 {
  margin: 0 0 18px; font: 800 clamp(40px,7vw,80px)/.95 var(--fd); letter-spacing: -.045em; text-wrap: balance;
}
.legal-meta { margin: 0; font-size: 15px; font-weight: 500; }
.legal-meta strong { font-weight: 700; }
.legal-lang { margin: 6px 0 0; font-size: 15px; font-weight: 500; }

/* The short version: a cream card tucked under the title, like the Home deck. */
.legal-summary {
  margin: 12px 0 0; padding: var(--p); border-radius: var(--r); background: var(--card);
  color: var(--ink); font-size: 17px;
}
.legal-summary > strong { display: block; font: 800 clamp(24px,2.8vw,32px)/1.08 var(--fd); letter-spacing: -.03em; }
.legal-summary ul { margin: 14px 0 0; padding: 0; list-style: none; }
.legal-summary li { position: relative; padding-left: 32px; }
.legal-summary li + li { margin-top: 10px; }
.legal-summary li::before {
  content: ''; position: absolute; left: 2px; top: .3em; width: 18px; height: 18px;
  background: var(--acct);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5.5 5.5L20 7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5.5 5.5L20 7'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Contents */
.legal-toc {
  margin: 12px 0 0; padding: 0 var(--p); border-radius: var(--r);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.legal-toc summary {
  display: flex; align-items: center; min-height: 56px; cursor: pointer;
  font: 700 15px/1.2 var(--fu); list-style: none;
}
.legal-toc summary::-webkit-details-marker { display: none; }
.legal-toc summary::after {
  content: ''; margin-left: auto; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.legal-toc[open] summary::after { transform: rotate(180deg); }
.legal-toc ol {
  margin: 0; padding: 4px 0 20px 22px; font-size: 15px;
  columns: 2 260px; column-gap: 32px;
}
.legal-toc li { break-inside: avoid; padding: 3px 0; }
.legal-toc a { color: var(--acct); font-weight: 600; text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Sections: flat cards with big radii. */
.legal-doc section {
  margin-top: 12px; padding: var(--p); border-radius: var(--r); background: var(--card);
  scroll-margin-top: 16px;
}
.legal-doc h2 {
  margin: 0 0 14px; font: 800 clamp(24px,3vw,34px)/1.08 var(--fd); letter-spacing: -.03em; text-wrap: balance;
}
.legal-doc h3 { margin: 22px 0 8px; font: 700 19px/1.3 var(--fu); }
.legal-doc section p, .legal-doc section li { color: var(--ink2); font-size: 17px; line-height: 1.65; }
.legal-doc p { margin: 0; }
.legal-doc p + p { margin-top: 12px; }
.legal-doc section ul, .legal-doc section ol { padding-left: 22px; margin: 10px 0; }
.legal-doc section li + li { margin-top: 6px; }
.legal-doc section li::marker { color: var(--acct); }
.legal-doc strong { color: var(--ink); font-weight: 700; }
.legal-doc section a {
  color: var(--acct); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 1.5px; overflow-wrap: anywhere;
}
.legal-doc .caps { text-transform: none; font-weight: 700; color: var(--ink); }

/* Tables sit on the paper colour inside a card. */
.legal-table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 14px 0;
  background: var(--bg); border-radius: 20px; overflow: hidden; font-size: 15px;
}
.legal-table th, .legal-table td {
  text-align: left; vertical-align: top; padding: 12px 14px;
  border-bottom: 1.5px solid var(--line); color: var(--ink2); line-height: 1.5;
}
.legal-table tr:last-child td { border-bottom: 0; }
.legal-table th { font: 700 14px/1.3 var(--fu); color: var(--ink); background: var(--soft); }
.legal-table td:first-child { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) {
  /* Stack table rows on phones instead of forcing a sideways scroll. */
  .legal-table thead { display: none; }
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; width: 100%; }
  .legal-table tr { padding: 12px 14px; border-bottom: 1.5px solid var(--line); }
  .legal-table tr:last-child { border-bottom: 0; }
  .legal-table td { border: 0; padding: 2px 0; }
}

/* Footer: a soft card, as on the site. */
.legal-foot { padding: 0 clamp(16px,4vw,48px) 24px; }
.legal-foot-card {
  max-width: 1240px; margin: 0 auto; padding: var(--p); border-radius: var(--r); background: var(--soft);
  display: flex; flex-direction: column; gap: 18px;
}
.legal-foot nav { display: flex; flex-wrap: wrap; gap: 0 24px; font-size: 15px; font-weight: 600; }
.legal-foot nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.legal-foot nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.legal-foot nav a[aria-current="page"] { color: var(--acct); }
.legal-copy {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-top: 18px; border-top: 1.5px solid var(--line); font-size: 14px; color: var(--ink2);
}
.legal-motto { font-weight: 600; }

@media print {
  .legal-top, .legal-foot, .legal-toc { display: none; }
  .legal-hero, .legal-summary, .legal-doc section { background: none; color: #000; padding: 0; border-radius: 0; }
  .legal-doc section { margin-top: 24px; }
}
