/* Legal pages.
   Tokens, type scale and surfaces mirror the landing page so the two read as
   one site. Kept deliberately different from the landing page in two ways: the
   header pill is static rather than fixed, and every control stays at a 44px
   touch target on phones — scripts/verify-legal-mobile.cjs enforces both. */

:root {
  --accent: #5a4af5;
  --accent-dark: #4338ca;
  --accent-light: #efecff;
  --bg-cream: #f9f8f3;
  --surface: #ffffff;
  --text-dark: #2f2f33;
  --text-body: #1c1c1f;
  --muted: #606066;
  --border: #e2dff0;
  --radius-pill: 9999px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-4xl: 32px;
  --font: "DM Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* The same lavender wash the hero opens with, fading into cream. */
  background-color: var(--bg-cream);
  background-image:
    radial-gradient(1240px 560px at 50% -170px, rgba(108, 90, 248, 0.24), transparent 70%),
    radial-gradient(760px 420px at 88% -50px, rgba(90, 74, 245, 0.15), transparent 68%),
    radial-gradient(700px 400px at 6% -30px, rgba(140, 120, 255, 0.13), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text-body);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
}

::selection {
  background: rgba(90, 74, 245, 0.18);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3,
p,
li,
dt,
dd,
th,
td,
a {
  overflow-wrap: anywhere;
}

/* ─── HEADER ──────────────────────────────────────────── */

.legal-header {
  padding: 24px 0 0;
}

.legal-main,
.legal-footer-inner {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
}

.legal-header-inner {
  width: min(1064px, 92vw);
  margin: 0 auto;
}

.legal-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 16px 40px 16px 48px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 128px;
  height: auto;
}

/* Points back at the landing page's sections, so a reader who arrives here
   from an app store has the rest of the site one tap away. */
.legal-nav {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-left: auto;
}

.legal-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-dark);
  font-size: 18px;
  font-weight: 500;
  line-height: 24px;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s;
}

.legal-nav a:hover {
  color: var(--accent);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: rgba(90, 74, 245, 0.07);
  border: 1px solid rgba(90, 74, 245, 0.14);
  margin-left: 28px;
}

.lang-switch a {
  display: inline-flex;
  min-width: 44px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.lang-switch a:hover {
  color: var(--accent);
}

.lang-switch a[aria-current="true"] {
  background: var(--accent);
  color: var(--surface);
  box-shadow: 0 1px 3px rgba(90, 74, 245, 0.35);
}

/* ─── DOCUMENT ────────────────────────────────────────── */

.legal-main {
  padding: 96px 0 112px;
}

.legal-eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--text-dark);
  line-height: 1.1;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(44px, 6.6vw, 76px);
  font-weight: 300;
  letter-spacing: 0.005em;
}

h2 {
  margin: 72px 0 18px;
  font-size: clamp(27px, 3.1vw, 34px);
  font-weight: 400;
  letter-spacing: -0.015em;
}

h3 {
  margin: 40px 0 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

p,
ul,
ol {
  margin: 0 0 20px;
}

ul,
ol {
  padding-left: 24px;
}

li + li {
  margin-top: 10px;
}

.legal-main a {
  color: var(--accent-dark);
  text-decoration-color: rgba(90, 74, 245, 0.35);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.legal-main a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.effective-date {
  margin-bottom: 48px;
  color: var(--muted);
  font-size: 15px;
}

.summary {
  padding: 30px 34px;
  border: 1px solid rgba(90, 74, 245, 0.16);
  border-radius: var(--radius-4xl);
  background: var(--accent-light);
}

.summary p:last-child {
  margin-bottom: 0;
}

.company-details {
  display: grid;
  gap: 10px;
  margin: 28px 0;
  padding: 22px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.company-details div {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) 1fr;
  gap: 12px;
}

.company-details dt {
  color: var(--text-dark);
  font-weight: 600;
}

.company-details dd {
  margin: 0;
}

/* ─── TABLES ──────────────────────────────────────────── */
/* The wrapper owns the horizontal scroll; the table owns the rounded frame,
   which is why the borders sit on the cells rather than on a collapsed grid. */

.legal-table-wrap {
  max-width: 100%;
  margin: 28px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
  font-size: 15px;
}

th,
td {
  padding: 16px 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

tr > *:last-child {
  border-right: 0;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

th {
  background: var(--accent-light);
  color: var(--text-dark);
  font-weight: 600;
}

/* ─── FOOTER ──────────────────────────────────────────── */

.legal-footer {
  padding: 40px 0 44px;
  background: var(--accent);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.legal-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

.legal-footer a {
  color: #ffffff;
  text-decoration: none;
}

.legal-footer a:hover {
  text-decoration: underline;
}

@media (min-width: 769px) {
  .legal-header {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: min(1064px, 92vw);
    padding: 0;
  }

  .legal-header-inner {
    width: 100%;
  }

  /* Clears the floating bar, and keeps deep links from landing underneath it. */
  .legal-main {
    padding-top: 188px;
  }

  [id] {
    scroll-margin-top: 132px;
  }
}

@media (max-width: 1100px) {
  .legal-header-inner {
    padding: 14px 24px 14px 32px;
  }

  .legal-nav {
    gap: 28px;
  }

  .legal-nav a {
    font-size: 16px;
  }

  .lang-switch {
    margin-left: 20px;
  }
}

@media (max-width: 768px) {
  /* Below this the four labels stop fitting beside the logo and the switch;
     the logo keeps the route home. */
  .legal-nav {
    display: none;
  }

  .lang-switch {
    margin-left: auto;
  }

  .legal-header-inner {
    width: min(900px, calc(100% - 40px));
    min-height: 64px;
    padding: 8px 14px 8px 22px;
    border-radius: var(--radius-4xl);
  }

  .brand-logo {
    width: 108px;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .legal-main a,
  .legal-footer a {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    max-width: 100%;
    align-items: center;
    vertical-align: middle;
  }

  .legal-header {
    padding: 16px 0 0;
  }

  .legal-header-inner {
    gap: 16px;
    min-height: 60px;
    padding: 6px 10px 6px 18px;
  }

  .brand-logo {
    width: 96px;
  }

  [id] {
    scroll-margin-top: 24px;
  }

  .lang-switch a {
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
  }

  .legal-main {
    padding: 56px 0 72px;
  }

  /* The 16px body-text floor applies to the date line too. */
  .effective-date {
    font-size: 16px;
  }

  h2 {
    margin-top: 52px;
  }

  h3 {
    margin-top: 32px;
    font-size: 18px;
  }

  .summary {
    padding: 24px;
    border-radius: var(--radius-2xl);
  }

  .company-details {
    padding: 18px 20px;
  }

  .company-details div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  table {
    min-width: 620px;
    font-size: 16px;
  }

  th,
  td {
    padding: 13px 14px;
  }
}
