/* ---------------------------------------------------------------------------
   Shared styles for the long-form legal documents (/termsofservice,
   /privacystatement). Same Evergreen tokens as the landing page; a reading
   measure and clause numbering rather than a marketing layout.

   These two pages share a stylesheet instead of inlining it, because the text
   is expected to be revised by a reviewer and the styling is not. The landing
   page stays self-contained.
--------------------------------------------------------------------------- */
:root {
  --surface-page: #F7F3EB;
  --surface-raised: #FFFDF8;
  --surface-inset: #F0EADC;

  --ink: #232B1F;
  --ink-secondary: #5A614F;
  --ink-muted: #8A8E7E;

  --hairline: #E3DCCB;
  --hairline-strong: #C9C0AA;

  --brand: #253D1E;
  --brand-hover: #1B2F15;
  --link: #2E5222;
  --brass: #7A5F1F;

  --font-display: "Iowan Old Style", "Palatino Nova", Palatino, "Book Antiqua", Georgia, serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 74ch;
  --gutter: clamp(22px, 5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: hidden; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::after {
  content: "";
  position: fixed; inset: 0 0 auto 0;
  height: 3px; z-index: 5;
  background: var(--brand);
}

.grain {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

.shell {
  position: relative; z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

a { color: var(--link); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--surface-raised); color: var(--link);
  padding: 8px 16px; border-radius: 8px; z-index: 30;
}
.skip-link:focus { left: 8px; }

/* --- Masthead ------------------------------------------------------------ */
.masthead { padding: clamp(38px, 6vw, 64px) 0 0; }
.masthead a.home { display: inline-block; color: var(--brand); }
.masthead svg { display: block; height: 26px; width: auto; }

.doc-head {
  margin: clamp(30px, 5vw, 48px) 0 clamp(26px, 4vw, 38px);
  padding-bottom: clamp(22px, 3vw, 30px);
  border-bottom: 1px solid var(--hairline);
}
.eyebrow {
  margin: 0 0 14px;
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--brass);
}
h1 {
  margin: 0;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08;
  letter-spacing: -0.018em; color: var(--brand);
  text-wrap: balance;
}
.doc-meta {
  margin: 18px 0 0;
  font-size: 0.85rem; color: var(--ink-secondary);
}
.doc-meta strong { color: var(--ink); font-weight: 600; }

/* --- Review notice ------------------------------------------------------- */
.notice {
  margin: 0 0 clamp(30px, 4vw, 42px);
  padding: 18px 22px;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--brass);
  border-radius: 8px;
  font-size: 0.9rem; line-height: 1.65;
  color: var(--ink-secondary);
}
.notice p { margin: 0; }
.notice p + p { margin-top: 10px; }

/* A detail still to be confirmed. Deliberately loud: these must not ship
   unnoticed. */
.fill {
  padding: 1px 6px;
  background: #F7EEDA;
  border-bottom: 1px dashed var(--brass);
  border-radius: 3px;
  color: #6B5316;
  font-size: 0.95em;
  white-space: nowrap;
}

/* --- Contents ------------------------------------------------------------ */
.toc {
  margin: 0 0 clamp(34px, 5vw, 50px);
  padding: 24px 26px;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.toc h2 {
  margin: 0 0 14px;
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-secondary);
}
.toc ol {
  margin: 0; padding: 0;
  list-style: none;
  columns: 2; column-gap: 34px;
  font-size: 0.9rem;
}
.toc li { margin: 0 0 7px; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc .n { color: var(--brass); font-variant-numeric: tabular-nums; margin-right: 8px; }
@media (max-width: 620px) { .toc ol { columns: 1; } }

/* --- Document body ------------------------------------------------------- */
main { max-width: var(--measure); }
section { margin: 0 0 clamp(32px, 4.5vw, 46px); scroll-margin-top: 24px; }

h2.clause {
  display: flex; gap: 14px; align-items: baseline;
  margin: 0 0 14px;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.3rem, 2.6vw, 1.6rem); line-height: 1.22;
  letter-spacing: -0.008em; color: var(--brand);
}
h2.clause .n {
  flex: none;
  font-size: 0.78em; color: var(--brass);
  font-variant-numeric: tabular-nums;
}
h3 {
  margin: 26px 0 10px;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.06rem; line-height: 1.3; color: var(--ink);
}
p, li { color: var(--ink-secondary); line-height: 1.72; text-wrap: pretty; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin: 0 0 8px; }
li::marker { color: var(--hairline-strong); }
strong { color: var(--ink); font-weight: 600; }
main a { color: var(--link); }

/* --- Tables -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 0 0 18px; }
table {
  width: 100%; min-width: 460px;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: 8px;
}
caption {
  caption-side: top; text-align: left;
  padding: 0 0 10px;
  font-size: 0.8rem; color: var(--ink-muted);
}
th, td {
  padding: 11px 14px;
  text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-secondary); line-height: 1.55;
}
th {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink); background: var(--surface-inset);
}
tbody tr:last-child td { border-bottom: 0; }

/* --- Footer -------------------------------------------------------------- */
footer {
  margin-top: clamp(48px, 7vw, 76px);
  padding: 26px 0 40px;
  border-top: 1px solid var(--hairline);
}
.footer-row {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 12px 24px;
  font-size: 0.83rem; color: var(--ink-secondary);
}
.footer-row .mark { display: inline-flex; align-items: center; color: var(--brand); }
.footer-row .mark svg { display: block; height: 17px; width: auto; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-row a { color: var(--link); text-decoration: none; border-bottom: 1px solid rgba(46, 82, 34, 0.28); }
.footer-row a:hover { border-bottom-color: var(--link); }
@media (max-width: 620px) { .footer-row { justify-content: center; text-align: center; } }

/* Trading disclosure required of a UK company on its website
   (Companies Act 2006 s.82; Trading Disclosures Regulations 2015). */
.company {
  margin: 14px 0 0;
  font-size: 0.76rem; line-height: 1.6;
  color: var(--ink-muted);
}
@media (max-width: 620px) { .company { text-align: center; } }

@media print {
  .grain, body::after, .toc, .skip-link { display: none; }
  body { background: #fff; font-size: 11pt; }
  main { max-width: none; }
  section { break-inside: avoid-page; }
  .fill { background: none; }
}
