/* -------------------------------------------------------------------------
   Shared stylesheet for the two static legal pages (privacy.html, tos.html).

   Like index.html these live in public/ and never pass through the Tailwind
   build, so the design tokens below are mirrored BY HAND from index.html's
   :root (brandinsightai.com's dark theme: Inter, neutral greys, Havas red).
   A token change there needs the same change here.

   index.html keeps its own inline <style> because it is a one-screen hero with
   layout rules nothing else uses. This file is the long-form document half:
   header, scrolling prose, footer. The header/footer/token rules are
   deliberately identical to index.html's so the three pages sit together.
   ------------------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/InterVariable-4.1-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --radius: 0.375rem;
  --background: #171717;
  --foreground: #f5f5f5;
  --card: #292929;
  --muted: #383838;
  --muted-foreground: #b3b3b3;
  --primary: #f5f5f5;
  --primary-foreground: #171717;
  --accent: #333333;
  --border: #474747;
  --ring: #ee1b24;
  /* Havas red: #ee1b24 for rules and rings, #d71921 for button fills
     (white text 5.18:1), #ff5c62 for small red text. */
  --brand-red: #ee1b24;
  --brand-red-fill: #d71921;
  --brand-red-dark: #b30000;
  --brand-red-text: #ff5c62;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid var(--border);
}

html {
  -webkit-text-size-adjust: 100%;
  /* Anchor links from the contents list shouldn't tuck the heading under the
     sticky header. */
  scroll-padding-top: 88px;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--background);
  color: var(--foreground);
  /* Inter throughout, matching index.html. */
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.serif {
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ring);
  border-radius: 6px;
}

.shell {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* --- Header: same sticky hairline bar as index.html ---------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background-color: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(8px);
}

@supports not (backdrop-filter: blur(8px)) {
  .site-header {
    background-color: var(--background);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

/* The product logo (links home), a hairline divider, then the Converged.AI
   mark, as on the landing page. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-home {
  display: inline-flex;
  border-radius: 6px;
  text-decoration: none;
}

.brand .converged-logo {
  height: 21px;
  width: auto;
}

.brand-divider {
  width: 1px;
  height: 42px;
  background-color: var(--border);
}

/* Same artwork the landing page and the in-app BrandMark use: the wordmark on
   transparency (brandshareofsearch-logo.png), which composites straight onto
   the dark canvas. NOT brandshareofsearch-final.svg or -final.png — both have
   an opaque black background, which shows up as a black chip here. The
   width/height attributes are the artwork's intrinsic size and only reserve
   the right aspect ratio; the height below is what actually sizes it. */
.brand .product-logo {
  height: 54px;
  width: auto;
}


/* Nav and actions: mirrored from index.html so the three pages share one
   header. Login is a link here (no script on these pages); it goes to
   /#login, which opens the landing page's login panel. */
.site-nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
}

.site-nav a,
.header-contact {
  color: var(--muted-foreground);
  white-space: nowrap;
  text-decoration: none;
  transition: color 150ms;
}

.site-nav a:hover,
.header-contact:hover {
  color: var(--foreground);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms, transform 150ms;
}

.btn:active {
  transform: scale(0.98);
}

/* Every button is a 6px rectangle (the class name is historical). */
.btn-pill,
.btn-pill:focus-visible {
  border-radius: 6px;
}

.btn-primary {
  background-color: var(--brand-red-fill);
  color: #ffffff;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--brand-red-dark);
}

.btn-primary:focus-visible {
  box-shadow:
    0 0 0 2px var(--background),
    0 0 0 4px var(--brand-red);
}

/* Login: the red primary with a sign-in icon on the left. */
.btn-login {
  height: 36px;
  padding-inline: 14px 16px;
  gap: 8px;
}

.btn-login svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}


@media (max-width: 860px) {
  .site-nav {
    display: none;
  }
}

/* Both logos stay on a phone, scaled down so Contact us and Login fit. */
@media (max-width: 620px) {
  .header-inner {
    gap: 12px;
  }

  .header-actions {
    gap: 10px;
  }

  .brand {
    gap: 7px;
  }

  .brand .converged-logo {
    height: 16px;
  }

  .brand .product-logo {
    height: 36px;
  }

  .brand-divider {
    height: 27px;
  }

  .header-contact {
    font-size: 13px;
  }

  .btn-login {
    padding-inline: 10px 12px;
    gap: 6px;
  }
}

/* --- Document ----------------------------------------------------------- */

main {
  flex: 1 1 auto;
  padding-block: 56px 80px;
}

/* ~72ch measure. Legal prose is read in long runs, so the column is the one
   thing on these pages that is NOT inherited from the hero. */
.doc {
  max-width: 72ch;
}

/* Red tracked caps, like the landing hero eyebrow (#ff5c62: 5.94:1).
   .doc .doc-eyebrow so it beats the .doc p colour. */
.doc .doc-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-red-text);
  margin-bottom: 14px;
}

.doc h1 {
  font-size: clamp(2rem, 1.4rem + 2.2vw, 2.75rem);
  margin-bottom: 16px;
}

.doc-meta {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 28px;
}

/* Visible "this text has not been through legal" banner. Delete this block —
   and the <aside class="draft-notice"> in both documents — once the wording is
   approved; nothing else depends on it. */
.draft-notice {
  border: 1px solid var(--border);
  border-left: 3px solid #d9a441;
  border-radius: var(--radius);
  background-color: var(--card);
  padding: 16px 18px;
  margin-bottom: 44px;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
}

.draft-notice strong {
  color: var(--foreground);
  font-weight: 500;
}

/* Contents list. Plain anchors, no JS. */
.doc-toc {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-block: 20px;
  margin-bottom: 48px;
}

.doc-toc h2 {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  font-weight: 500;
  margin-bottom: 12px;
}

.doc-toc ol {
  columns: 2;
  column-gap: 40px;
  list-style: none;
  counter-reset: toc;
  font-size: 0.9375rem;
}

.doc-toc li {
  counter-increment: toc;
  break-inside: avoid;
  margin-bottom: 6px;
}

.doc-toc li::before {
  content: counter(toc, decimal-leading-zero) ". ";
  color: var(--muted-foreground);
}

.doc-toc a {
  color: var(--muted-foreground);
  text-decoration: none;
}

.doc-toc a:hover {
  color: var(--foreground);
  text-decoration: underline;
}

.doc section {
  margin-bottom: 44px;
  scroll-margin-top: 88px;
}

.doc h2 {
  font-size: 1.375rem;
  margin-bottom: 14px;
}

.doc h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-top: 22px;
  margin-bottom: 8px;
}

.doc p,
.doc li {
  color: var(--muted-foreground);
  font-size: 1rem;
}

.doc p + p {
  margin-top: 14px;
}

.doc ul,
.doc ol.rules {
  margin-top: 14px;
  padding-left: 22px;
}

.doc li + li {
  margin-top: 8px;
}

.doc strong {
  color: var(--foreground);
  font-weight: 500;
}

.doc a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Bracketed placeholders awaiting legal sign-off, so they can't be missed. */
.todo {
  color: #d9a441;
  font-style: normal;
}

/* Retention / legal-basis table. Scrolls sideways on a phone rather than
   forcing the whole page wide. */
.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 620px;
  font-size: 0.9375rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
}

th {
  color: var(--foreground);
  font-weight: 500;
  background-color: var(--muted);
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* --- Footer: identical to index.html, plus the legal links --------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 20px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--muted-foreground);
  text-decoration: none;
}

.footer-links a:hover,
.footer-credit:hover {
  color: var(--foreground);
  text-decoration: underline;
}

.footer-credit {
  color: var(--muted-foreground);
  text-decoration: none;
}

/* "Built by" + the Havas Middle East lockup (inline SVG). */
.footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}

.footer-logo {
  flex: none;
  height: 22px;
  width: auto;
}

/* External links open in a new tab; the arrow says so, as on the landing
   page. */
.footer-credit::after {
  content: "\2197";
  content: "\2197" / " (opens in a new tab)";
  display: inline-block;
  margin-left: 0.15em;
  font-size: 0.85em;
}

@media (max-width: 720px) {
  main {
    padding-block: 36px 56px;
  }

  .doc-toc ol {
    columns: 1;
  }
}

/* Phones: the header keeps the product logo, Contact us and Login; the
   Converged.AI mark has no room and stays out, as on the landing page. */
@media (max-width: 640px) {
  .brand-divider,
  .brand .converged-logo {
    display: none;
  }

  .brand .product-logo {
    height: 30px;
  }
}
