/* Shared styling for the long-form legal pages (tos.html, privacy.html,
   refunds.html).
   
   The other marketing pages each carry their own inline <style> block because
   each has a bespoke layout. The three legal pages share one layout — a fixed
   table of contents beside a single prose column — so the CSS lives here once
   rather than being triplicated. Palette and type scale match the inline
   blocks in index.html / about.html / how-it-works.html. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:      #0D1B2A;
  --navy-mid:  #162436;
  --navy-lt:   #1E3347;
  --gold:      #C9A84C;
  --gold-lt:   #E8C97A;
  --white:     #FDFAF4;
  --offwhite:  #F5F2EA;
  --grey-lt:   #EAE6DC;
  --grey-dk:   #8A8070;
  --ink-muted: #6B7A8D;
  --ink:       #0D1B2A;
  --shadow-card: 0 2px 12px rgba(13,27,42,0.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--white);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.serif { font-family: 'Libre Baskerville', Georgia, serif; }

/* ────────────────── Page header ────────────────── */

.legal-header {
  background: var(--navy);
  color: var(--white);
  padding: 72px 32px 64px;
  text-align: center;
}
.legal-header .eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}
.legal-header h1 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.01em;
}
.legal-header .dates {
  margin-top: 22px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: rgba(253,250,244,0.66);
}
.legal-header .dates span + span::before {
  content: '·';
  margin: 0 10px;
  color: rgba(253,250,244,0.35);
}

/* ────────────────── Layout ────────────────── */

.legal-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 32px 88px;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 24px;
  border-left: 2px solid var(--grey-lt);
  padding-left: 18px;
}
.legal-toc-title {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-dk);
  margin-bottom: 14px;
}
.legal-toc a {
  display: block;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 5px 0;
  transition: color 0.15s;
}
.legal-toc a:hover { color: var(--navy); }

.legal-body { max-width: 72ch; }

/* ────────────────── Prose ────────────────── */

.legal-body .lede {
  font-size: 18px;
  line-height: 1.65;
  color: var(--navy-lt);
  padding-bottom: 28px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--grey-lt);
}

.legal-body section { padding-top: 40px; }

.legal-body h2 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
  scroll-margin-top: 24px;
}
.legal-body h2 .num {
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--gold);
  margin-right: 10px;
}

.legal-body h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 26px 0 10px;
  color: var(--navy);
}

.legal-body p { font-size: 15.5px; line-height: 1.72; margin-bottom: 15px; }
.legal-body ul, .legal-body ol { margin: 0 0 15px 22px; }
.legal-body li { font-size: 15.5px; line-height: 1.72; margin-bottom: 9px; }
.legal-body a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.legal-body a:hover { color: var(--gold); }
.legal-body strong { font-weight: 700; }

/* Emphasised callout — used for the guarantee, the "we are not the provider"
   notice, and similar statements a reader must not miss. */
.callout {
  background: var(--offwhite);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin: 22px 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout .callout-title {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-dk);
  margin-bottom: 8px;
}

/* Statutory/liability blocks that convention sets in caps. */
.legal-body .allcaps { text-transform: uppercase; font-size: 13.5px; letter-spacing: 0.01em; }

/* Definition list for the glossary and the cookie/sub-processor tables. */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 22px;
  font-size: 14.5px;
}
.legal-table th, .legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 11px 14px;
  border-bottom: 1px solid var(--grey-lt);
  line-height: 1.6;
}
.legal-table th {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-dk);
  border-bottom: 2px solid var(--grey-lt);
  white-space: nowrap;
}
/* Every cell wraps, so a table fits the page at any width: the first column holds whole sentences
   in some tables (Payment data), and a no-wrap first column pushed those far past a phone's edge. */
.legal-table td { overflow-wrap: break-word; }
.legal-table td:first-child { font-weight: 600; }
/* A table whose first column is sentences, not labels (Payment data), reads better unbolded. */
.legal-table.plain-first td:first-child { font-weight: 400; }
.table-scroll { overflow-x: auto; }

/* Placeholder for a value only the company can supply (legal entity name,
   registered address, governing law). Deliberately loud so it cannot ship
   unnoticed. Delete the <span> along with its brackets when filling one in. */
.todo {
  background: #FFF4CC;
  border-bottom: 2px solid var(--gold);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'DM Mono', monospace;
  font-size: 0.92em;
  color: #6B5410;
}

.legal-contact {
  margin-top: 44px;
  padding: 26px 28px;
  background: var(--navy);
  color: var(--white);
  border-radius: 10px;
}
.legal-contact h2 { color: var(--white); margin-bottom: 12px; }
.legal-contact p { color: rgba(253,250,244,0.82); margin-bottom: 8px; }
.legal-contact a { color: var(--gold-lt); }
.legal-contact a:hover { color: var(--white); }

/* ────────────────── Responsive ────────────────── */

@media (max-width: 900px) {
  .legal-shell {
    /* minmax(0, ...) so a wide table scrolls inside .table-scroll; a plain 1fr column grows to
       the table's width and pushed the whole page off the right edge of a phone. */
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 40px 24px 64px;
  }
  .legal-toc {
    position: static;
    border-left: none;
    border-top: 1px solid var(--grey-lt);
    border-bottom: 1px solid var(--grey-lt);
    padding: 20px 0;
  }
  .legal-header { padding: 56px 24px 48px; }
}

/* ────────────────── Site footer ──────────────────
   Copied verbatim from the inline <style> blocks in index.html / about.html /
   how-it-works.html / contact.html so the footer on a legal page is identical to the
   footer everywhere else - change both together. Nav styling needs no counterpart here — js/nav.js injects
   its own <style> block along with the <nav> element. */

.lf-footer, .lf-footer * { box-sizing: border-box; }
.lf-footer {
  background: #0D1B2A;
  border-top: 1px solid #1E3347;
  padding: 64px 48px 32px;
  text-align: left;
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: flex;
  /* The link columns, then the copyright line across the bottom. */
  flex-direction: column;
  align-items: center;
}
.lf-footer .footer-grid {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto 64px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
.lf-footer .footer-wordmark {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
}
/* Height-only sizing preserves the approved lockup proportions. */
.lf-footer .footer-wordmark img { display: block; height: 38px; width: auto; }
.lf-footer .footer-tagline {
  font-family: 'Libre Baskerville', serif;
  font-style: italic;
  font-size: 14px;
  color: #6B7A8D;
  line-height: 1.55;
  max-width: 260px;
  margin: 0;
}
.lf-footer .footer-col-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8A8070;
  margin-bottom: 16px;
}
.lf-footer .footer-link {
  display: block;
  font-size: 14px;
  color: #6B7A8D;
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.18s;
}
.lf-footer .footer-link:hover { color: #FDFAF4; }
.lf-footer .footer-bottom {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid #1E3347;
}
.lf-footer .footer-copy {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #6B7A8D;
  letter-spacing: 0.06em;
}
.lf-footer .footer-disclaimer {
  max-width: 1040px;
  margin: 14px auto 0;
  font-size: 12px;
  line-height: 1.5;
  color: #6B7A8D;
}
@media (max-width: 760px) {
  /* Narrower cells and headings that may wrap, so a three-column table fits a small phone. */
  .legal-table th, .legal-table td { padding: 10px 8px; }
  .legal-table th { white-space: normal; }
  /* On a phone the footer is one centred column: the wordmark and tagline, then each
     section's heading with its links flowing side by side beneath it, then the copyright. */
  .lf-footer { padding: 40px 20px 28px; text-align: center; }
  .lf-footer .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; margin-bottom: 28px; justify-items: center; }
  .lf-footer .footer-grid > div { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 18px; row-gap: 2px; max-width: 340px; }
  .lf-footer .footer-grid > :first-child { flex-direction: column; align-items: center; }
  .lf-footer .footer-col-title { flex-basis: 100%; margin-bottom: 6px; }
  .lf-footer .footer-link { display: inline-block; padding: 3px 0; }
  .lf-footer .footer-bottom { justify-content: center; }
  /* Tighter spacing keeps the copyright on one line on most phones. */
  .lf-footer .footer-copy { letter-spacing: 0.02em; }
}
