/* Static public pages (legal: T6.3, connector guide: T7.2), readable
   without signing in: the connector directories link to them. French
   under /legal and /aide, English under /legal (privacy, terms,
   legal-notice) and /help (T8.5).
   "Formes" look (T8.1): the same tokens as src/lib/tokens.css, Jost and
   Figtree served from /fonts (no third party), ink rules, paper grain. */
@font-face {
  font-family: 'Jost Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/jost-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Figtree Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url('/fonts/figtree-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  --color-bg: #efede8;
  --color-surface: #f8f7f4;
  --color-text: #17171a;
  --color-text-muted: #6b6a66;
  --color-divider: #d9d6cf;
  --color-ink-line: var(--color-text);
  --color-on-shape: #17171a;
  --color-orange: #ee6a3c;
  --color-blue: #3c62e0;
  --color-yellow: #f4c233;
  --color-green: #3c9a5c;
  --font-heading: 'Jost Variable', 'Futura', 'Avenir Next', system-ui, sans-serif;
  --font-body: 'Figtree Variable', system-ui, sans-serif;
  --border: 1.5px;
  --paper-blend: multiply;
  --paper-opacity: 0.55;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #151518;
    --color-surface: #1f1f23;
    --color-text: #f3f1ec;
    --color-text-muted: #a3a19b;
    --color-divider: #34343a;
    --color-on-shape: #151518;
    --color-orange: #ff7c4d;
    --color-blue: #6c8cff;
    --color-yellow: #ffd04a;
    --color-green: #4fbb73;
    --paper-blend: screen;
    --paper-opacity: 0.18;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}

/* The decorative shapes hang past the right edge: never scroll sideways. */
body {
  position: relative;
  overflow-x: clip;
}

/* Risograph paper over the whole page. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  mix-blend-mode: var(--paper-blend);
  opacity: var(--paper-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5  0 0 0 0 .48  0 0 0 0 .45  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23p)'/%3E%3C/svg%3E");
}

/* Two shapes from the cast's palette, behind the title. */
.deco {
  position: absolute;
  top: -90px;
  right: -70px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: var(--color-orange);
  z-index: -1;
}
.deco::after {
  content: '';
  position: absolute;
  left: -70px;
  bottom: -30px;
  width: 120px;
  height: 60px;
  border-radius: 120px 120px 0 0;
  background: var(--color-blue);
}

.top,
main {
  max-width: 760px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
main {
  position: relative;
  padding-block: 0 72px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: max(22px, env(safe-area-inset-top, 0px)) 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: inherit;
  text-decoration: none;
}
.brand b {
  color: var(--color-orange);
}
.lang {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  border: var(--border) solid var(--color-ink-line);
  background: var(--color-surface);
  padding: 5px 10px;
}
.lang:hover {
  background: var(--color-text);
  color: var(--color-surface);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 40px;
}
nav a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: inherit;
  text-decoration: none;
  border: var(--border) solid var(--color-ink-line);
  background: var(--color-surface);
  padding: 4px 12px;
  border-radius: 999px;
}
nav a:hover {
  background: var(--color-yellow);
  color: var(--color-on-shape);
}
nav a[aria-current='page'] {
  background: var(--color-text);
  color: var(--color-surface);
}

a {
  color: var(--color-blue);
  text-underline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  text-wrap: balance;
}
h1 {
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  max-width: 14em;
}
h2 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 44px 0 10px;
  padding-top: 18px;
  border-top: var(--border) solid var(--color-ink-line);
}
h3 {
  font-size: 19px;
  margin: 26px 0 6px;
}

.updated {
  color: var(--color-text-muted);
  font-size: 14px;
  margin: 0 0 28px;
}

/* "The French text is the reference" on the English legal pages. */
.translation {
  display: inline-block;
  font-size: 14px;
  background: var(--color-yellow);
  color: var(--color-on-shape);
  border: var(--border) solid var(--color-ink-line);
  padding: 6px 12px;
  margin: 0 0 24px;
}
.translation a {
  color: inherit;
}

.callout {
  background: var(--color-surface);
  border: var(--border) solid var(--color-ink-line);
  box-shadow: 5px 5px 0 var(--color-green);
  padding: 4px 18px;
  margin: 22px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 14px 0;
  background: var(--color-surface);
  border: var(--border) solid var(--color-ink-line);
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-divider);
}
th {
  font-family: var(--font-heading);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: var(--border) solid var(--color-ink-line);
}
.table-scroll {
  overflow-x: auto;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  padding: 1px 5px;
  overflow-wrap: anywhere;
}
pre {
  background: var(--color-surface);
  border: var(--border) solid var(--color-ink-line);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.45;
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  overflow-wrap: normal;
}

ol li,
ul li {
  margin-bottom: 6px;
}
ul li::marker {
  color: var(--color-orange);
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .deco {
    width: 170px;
    height: 170px;
    top: -70px;
    right: -60px;
  }
  .deco::after {
    display: none;
  }
}
