/* Shared contract for every public page: self-hosted IBM Plex (D-00b), Ledger palette tokens from
   design/Sentry Trader B - Ledger.dc.html, the shared header/footer shell and shared components.
   All styling lives in files: the CSP allows no inline style (D-07). Page-family styles go in their
   own files (home.css, legal.css, support.css).
   Contrast (WCAG 2.2 AA, RESEARCH Pitfall 4): text on light backgrounds is oklch L 0.52 or darker,
   text on the dark band and footer is L 0.72 or lighter, form-control borders use L 0.62 (3:1). */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-serif-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-serif-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-serif-latin-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  --bg: oklch(0.975 0.004 250);
  --card: oklch(0.995 0.002 250);
  --band: oklch(0.945 0.006 250);
  --ink: oklch(0.26 0.015 250);
  --muted: oklch(0.42 0.014 250);
  --muted-light: oklch(0.52 0.014 250);
  --link: oklch(0.48 0.13 225);
  --link-hover: oklch(0.38 0.13 225);
  --brand: oklch(0.52 0.13 225);
  --border: oklch(0.9 0.006 250);
  --control-border: oklch(0.62 0.014 250);
  --dark: oklch(0.26 0.015 250);
  --footer: oklch(0.22 0.014 250);
  --footer-rule: oklch(0.32 0.014 250);
  --on-dark: oklch(0.95 0.004 250);
  --on-dark-muted: oklch(0.78 0.008 250);
  --on-dark-accent: oklch(0.8 0.1 225);
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "IBM Plex Serif", ui-serif, Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --header-h: 64px;
}

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

/* WCAG 2.4.11: anchors and focused elements are not hidden under the sticky header. */
html {
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* WR-06 / WCAG 1.4.1: links are underlined, not distinguished by colour alone. */
a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

.page {
  padding-top: 96px;
  padding-bottom: 96px;
}

/* Skip link: off-screen until focused (WCAG 2.4.1). */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--on-dark);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: oklch(0.975 0.004 250 / 0.95);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  min-height: var(--header-h);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 10px;
  height: 10px;
  background: var(--brand);
}

.brand-wordmark {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin-left: auto;
  font-size: 14px;
}

/* WCAG 2.5.8: 24x24 px minimum targets. */
.site-nav a {
  display: inline-block;
  padding: 4px 0;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.site-download {
  display: flex;
  align-items: center;
  gap: 10px;
}

.invite-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* A wrapped header can be tall on narrow screens; let it scroll away rather than cover content. */
@media (max-width: 760px) {
  .site-header {
    position: static;
  }

  html {
    scroll-padding-top: 16px;
  }

  .site-nav {
    margin-left: 0;
  }
}

/* Main */
.site-main h1 {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0 0 32px;
  max-width: 560px;
  font-size: 18px;
}

.risk-note {
  margin: 0;
  padding-top: 16px;
  max-width: 560px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

/* Long-form text: legal pages and the accessibility statement. */
.prose {
  max-width: 72ch;
}

.prose h2 {
  margin: 40px 0 12px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
}

.prose h3 {
  margin: 28px 0 8px;
  font-size: 17px;
  font-weight: 600;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 16px;
}

.prose li {
  margin-bottom: 6px;
}

.meta {
  font-size: 14px;
  color: var(--muted);
}

/* Buttons. White on brand is 4.96:1. */
.button {
  display: inline-block;
  padding: 12px 20px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}

.button:hover {
  background: var(--link-hover);
  border-color: var(--link-hover);
  color: #fff;
}

.button-secondary {
  background: transparent;
  border-color: var(--control-border);
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--band);
  border-color: var(--ink);
  color: var(--ink);
}

.site-download .button {
  padding: 8px 16px;
  font-size: 14px;
}

/* FAQ: native details/summary, no JS (D-18). */
details {
  border-bottom: 1px solid var(--border);
}

summary {
  min-height: 24px;
  padding: 14px 0;
  font-weight: 500;
  cursor: pointer;
}

details > :not(summary) {
  margin-top: 0;
}

.caption {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-light);
}

/* Footer (dark). */
.site-footer {
  background: var(--footer);
  color: var(--on-dark-muted);
}

.site-footer :focus-visible {
  outline-color: var(--on-dark-accent);
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 48px;
  padding-bottom: 56px;
}

.site-footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--footer-rule);
}

.site-footer .brand {
  color: var(--on-dark);
}

.site-footer .brand-mark {
  background: oklch(0.7 0.11 225);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  font-size: 14px;
}

.footer-nav a {
  display: inline-block;
  padding: 4px 0;
  color: var(--on-dark-muted);
}

.footer-nav a:hover {
  color: var(--on-dark);
}

.footer-disclaimers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 18px 40px;
  font-size: 13px;
  line-height: 1.65;
}

.footer-disclaimers p,
.footer-legal {
  margin: 0;
}

.footer-legal {
  font-size: 13px;
  color: var(--on-dark);
}

/* Motion only for people who have not asked for less (WCAG 2.3.3). */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  a,
  .button {
    transition:
      color 0.15s ease,
      background-color 0.15s ease,
      border-color 0.15s ease;
  }
}
