/*
 * Bestie legal pages — shared stylesheet for /terms and /privacy.
 *
 * TYPOGRAPHY — system faces only, deliberately (BES-161).
 *
 * These pages used to declare @font-face for Canela Condensed, Akzidenz Grotesk
 * and Inter against /assets/fonts/<name>.<ext>. Those URLs never resolved: the
 * site build content-hashes every published asset, so the files actually served
 * are /assets/fonts/CanelaCondensed-Medium.<hash>.otf and friends. legal.css is
 * copied verbatim by build.sh and is not rewritten, so it cannot name a hash.
 * The rules were dead weight, and build.sh's assertion on the unhashed names
 * could never pass — which is what broke the deploy.
 *
 * They are not coming back by way of the pull list either: Canela and Akzidenz
 * are trial-licensed cuts (BES-133/BES-138), and republishing them here would be
 * exactly the exposure apps/api/src/api/brand.css already refuses to create.
 *
 * The three roles survive as system stacks:
 *
 *   --voice   system serif      — display. Editorial, still a serif voice.
 *   --body    system sans       — running text.
 *   --metric  condensed sans    — labels, eyebrows, table headers. Uppercase,
 *                                 wide-tracked.
 *
 * COLOUR
 * Values are the brand guidelines' tokens, which are what the rest of
 * mybestie.io renders. They differ very slightly from brand.css (background
 * #FBF8F2 vs #FCF8F2, ink #151217 vs #161318, accent #9F365E vs #D64A8C) because
 * brand.css mirrors the iOS asset catalog and these pages sit on the marketing
 * site. Matching the neighbour is the right call for a page users reach from the
 * site's own footer.
 *
 * LIGHT ONLY, deliberately. mybestie.io is a single warm-cream visual world with
 * no dark variant; a /privacy that flipped to dark while the page linking to it
 * stayed cream would read as a different site. `color-scheme: light` keeps form
 * controls and scrollbars consistent with that choice.
 */

:root {
  color-scheme: light;

  /* Brand palette — bestie-brand-guidelines.html */
  --magenta: #d64a8c;
  --coral: #ff7a59;
  --violet: #7e6bd8;
  --aqua: #3ec5c0;
  --lilac: #ebddf3;
  --cream: #fff6e8;
  --stone: #d9d2c6;

  /* Surfaces + ink */
  --background: #fbf8f2;
  --surface: #fffefc;
  --ink: #151217;
  --muted: #6c6470;
  --faint: #9a929c;
  --hairline: #ded4c8;

  /* The marketing site's accent is the deeper magenta, not the brand magenta —
     it holds up as link colour on cream where #D64A8C is too light. */
  --accent: #9f365e;

  --voice: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --body:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    sans-serif;
  --metric: "Arial Narrow", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--body);
  /* A shade larger than the site's 15.5px marketing body: these are the longest
     documents on the domain and are read start to finish, not scanned. */
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.l-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 104px;
}

/* ------------------------------------------------------------------ masthead */

.l-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--metric);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 34px;
}

.l-back:hover {
  color: var(--accent);
}

.l-back::before {
  content: "\2190";
  font-family: var(--body);
  letter-spacing: 0;
}

/* The wordmark is set in the display face, as everywhere else in the brand. */
.l-wordmark {
  font-family: var(--voice);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1;
  margin: 0 0 10px;
}

.l-wordmark::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--magenta);
  vertical-align: baseline;
}

h1 {
  font-family: var(--voice);
  font-weight: 500;
  /* Stepped down from the old clamp, which was tuned for a condensed face. A
     system serif sets much wider at the same point size, so 4.2rem/0.96 read as
     oversized and cramped once Canela was gone. */
  font-size: clamp(2.5rem, 6vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  text-wrap: balance;
}

.l-dates {
  font-family: var(--metric);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 40px;
}

/* -------------------------------------------------------------------- summary
   A plain-language précis above the operative text. Not a substitute for the
   sections below, and it says so — but a policy nobody reads protects nobody. */

.l-summary {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--aqua);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 26px;
  margin-bottom: 48px;
}

.l-summary h2 {
  font-family: var(--metric);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  line-height: 1;
}

.l-summary ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15.5px;
}

.l-summary p {
  margin: 16px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------------------ toc */

.l-toc {
  margin-bottom: 52px;
}

.l-toc h2 {
  font-family: var(--metric);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1;
}

.l-toc ol {
  margin: 0;
  padding-left: 24px;
  columns: 2;
  column-gap: 32px;
  font-size: 14.5px;
}

.l-toc li {
  margin-bottom: 5px;
  break-inside: avoid;
}

.l-toc a {
  color: var(--ink);
  text-decoration: none;
}

.l-toc a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ------------------------------------------------------------------- sections
   Numbered because legal text is cross-referenced by number, not because
   numbering looks tidy. */

section {
  margin-bottom: 44px;
  scroll-margin-top: 24px;
}

h2 {
  font-family: var(--voice);
  font-weight: 500;
  font-size: 27px;
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  text-wrap: balance;
}

/* Sub-headings step down to the body face — a third serif size in running text
   starts to read as decoration rather than hierarchy. */
h3 {
  font-family: var(--body);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.002em;
  margin: 28px 0 9px;
}

p,
li {
  max-width: 66ch;
}

p {
  margin: 0 0 15px;
}

ul,
ol {
  margin: 0 0 15px;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: rgba(217, 210, 198, 0.42);
  border-radius: 5px;
  padding: 1.5px 5px;
}

/* -------------------------------------------------------------------- callout
   Reserved for the two things a reader must not miss: that Bestie is not
   medical advice, and that photos are processed by third-party AI providers. */

.l-callout {
  background: rgba(255, 122, 89, 0.11);
  border-left: 3px solid var(--coral);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px;
  margin: 0 0 20px;
}

.l-callout p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------- tables */

.l-scroll {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

/* Table headers take the metric role — uppercase and wide-tracked, the same
   treatment the app gives a score label. */
th {
  text-align: left;
  font-family: var(--metric);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 13px 16px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(222, 212, 200, 0.5);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

/* --------------------------------------------------------------------- footer */

.l-foot {
  border-top: 1px solid var(--hairline);
  padding-top: 26px;
  font-family: var(--metric);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.l-foot a {
  color: var(--muted);
  text-decoration: none;
}

.l-foot a:hover {
  color: var(--accent);
}

@media (max-width: 620px) {
  .l-shell {
    padding: 28px 18px 72px;
  }
  body {
    font-size: 16px;
  }
  h2 {
    font-size: 25px;
  }
  .l-toc ol {
    columns: 1;
  }
}
