/* ============================================================================
   Legal pages — privacy and terms.
   ----------------------------------------------------------------------------
   These carry real policy text that people and app-store reviewers rely on, so
   the job here is legibility, not art direction. Same two brands, same tokens,
   one long measure, nothing that moves.

   Set data-brand="spark" or data-brand="bloom" on <html>.
   ========================================================================== */

:root {
  --canvas: #FFF8EC;
  --ink:    #2E2218;
  --soft:   #6B5B45;
  --accent: #7A5C11;
  --line:   #E6D7B8;
  --font-display: "Nunito", system-ui, sans-serif;
  --font-text:    "Nunito", system-ui, sans-serif;
  --radius: 14px;
  --measure: 68ch;
}

/* Bloom's own palette and hand. The muted stop is one step darker than the
   brand's #8A7A63, which measures 3.9:1 on this paper and misses the 4.5:1
   body floor. */
:root[data-brand="bloom"] {
  --canvas: #FBF3E0;
  --ink:    #3A3128;
  --soft:   #6F6250;
  --accent: #2F7357;
  --line:   #DFD2B4;
  --font-display: "Caveat", "Segoe Print", cursive;
  --font-text:    "Patrick Hand", "Segoe Print", cursive;
  --radius: 20px 6px 22px 8px / 8px 20px 6px 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 clamp(1.25rem, 5vw, 3rem) 5rem;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: clamp(1rem, 0.96rem + 0.22vw, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
:root[data-brand="bloom"] body { font-size: clamp(1.08rem, 1rem + 0.3vw, 1.2rem); }

::selection { background: var(--accent); color: var(--canvas); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.legal { max-width: var(--measure); margin-inline: auto; }

.legal__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  max-width: var(--measure); margin: 0 auto;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.legal__mark { font-family: var(--font-display); font-weight: 900; font-size: 1rem; text-decoration: none; color: var(--ink); }
:root[data-brand="bloom"] .legal__mark { font-weight: 700; font-size: 1.45rem; }
.legal__back { font-size: 0.9rem; color: var(--soft); text-decoration: none; border-bottom: 1px solid var(--line); }
.legal__back:hover { color: var(--ink); border-color: var(--accent); }

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  line-height: 1.04; margin: 0 0 0.4rem;
  letter-spacing: -0.03em; text-wrap: balance;
}
:root[data-brand="bloom"] h1 { letter-spacing: 0; font-weight: 700; }

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  line-height: 1.2;
  /* More space above a heading than below it: the gap belongs to the boundary
     between sections, not to the heading-and-body pair. */
  margin: 2.75rem 0 0.6rem;
  letter-spacing: -0.02em;
}
:root[data-brand="bloom"] h2 { letter-spacing: 0; }

p, ul { margin: 0 0 1rem; text-wrap: pretty; }
ul { padding-left: 1.3rem; }
li { margin-bottom: 0.4rem; }
strong { font-weight: 800; }
:root[data-brand="bloom"] strong { font-weight: 400; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }

.updated {
  color: var(--soft); font-size: 0.92rem;
  margin-bottom: 2.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

/* The source pages open with a small wordmark div. It becomes the page's own
   lockup rather than a stray line of text above the h1. */
.logo {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 900; color: var(--accent);
  margin-bottom: 0.75rem; letter-spacing: -0.02em;
}
:root[data-brand="bloom"] .logo { font-weight: 700; font-size: 1.6rem; letter-spacing: 0; }

.legal__foot {
  max-width: var(--measure); margin: 3.5rem auto 0;
  padding-top: 1.5rem; border-top: 1px solid var(--line);
  color: var(--soft); font-size: 0.9rem;
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between;
}
.legal__foot p { margin: 0; }

/* The two source pages use different class names for the same jobs. Both are
   supported so the policy markup could be carried across untouched. */
.wrap { display: contents; }

.sub {
  color: var(--soft); font-size: 0.95rem;
  margin: 0 0 1.5rem;
}

.divider { margin: 0 0 2rem; }
.divider svg { display: block; width: 100%; height: 8px; opacity: 0.45; }

/* Bloom's standing disclaimer. It is the most important block on the page, so
   it gets a surface rather than a coloured left border. */
.note {
  background: color-mix(in oklab, var(--accent) 8%, var(--canvas));
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 1.5rem);
  margin: 0 0 1.5rem;
}
.note strong:first-child { display: block; margin-bottom: 0.35rem; }
