/*
 * Shared styling for the public legal pages.
 *
 * These two pages are served OUTSIDE the app shell: no React, no Clerk, no
 * bundle. Google's OAuth verification fetches them unauthenticated, and a page
 * that needs a session to render is a page Google records as missing. So they
 * are plain static HTML in `public/`, and this is the only stylesheet they load.
 */

:root {
  --ink: #e2e8f0;
  --ink-soft: #94a3b8;
  /* Lifted from slate-500 #64748b (3.75:1 on --ground, below WCAG AA) to
     slate-400 (6.96:1): the only two users are the 13px .dates meta line and
     the 13px footer, both small text that has to clear 4.5:1. */
  --ink-faint: #94a3b8;
  --ground: #0f172a;
  --panel: #131f38;
  --rule: rgba(255, 255, 255, 0.09);
  --accent: #818cf8;
  --accent-deep: #4f46e5;
  --warn-ground: rgba(180, 83, 9, 0.14);
  --warn-rule: rgba(251, 146, 60, 0.35);
  --warn-ink: #fdba74;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 16px 96px;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.7 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
}

header.masthead {
  padding-block: 56px 32px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 40px;
}

.lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: 28px;
}

.mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.lockup .name {
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  display: block;
  line-height: 1.2;
}

.lockup .kicker {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 12px;
  text-wrap: balance;
}

.dates {
  color: var(--ink-faint);
  font-size: 13px;
  margin: 0;
}

h2 {
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  text-wrap: balance;
}

h2:first-of-type { border-top: 0; padding-top: 0; }

h3 {
  font-size: 0.95rem;
  color: #fff;
  margin: 28px 0 8px;
}

p, li { color: var(--ink); }

a { color: var(--accent); }

ul, ol { padding-left: 1.25rem; }

li { margin-bottom: 7px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.87em;
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 5px;
  border-radius: 4px;
  color: #c7d2fe;
  overflow-wrap: anywhere;
}

/*
 * These tables are wider than a phone (min-width: 34rem vs a 343px viewport), so
 * at 375px rows cut mid-word. With no fade and no visible scrollbar that reads
 * as truncated text rather than as something you can scroll, and a scrollable
 * region holding no focusable content is unreachable by keyboard — hence
 * `tabindex="0"` plus `role="region"` on each one in the HTML, and a focus ring
 * here so the tab stop is visible when it lands.
 *
 * The edge fades are `background-attachment: local` shadows: the two `local`
 * layers scroll with the content and cover the two `scroll` gradients at the
 * ends, so the fade appears only on a side that has more content off-screen.
 */
.table-scroll {
  overflow-x: auto;
  margin: 18px 0;
  scrollbar-color: var(--ink-soft) transparent;
  background:
    linear-gradient(to right, var(--ground), rgba(15, 23, 42, 0)) left center / 28px 100% no-repeat local,
    linear-gradient(to left, var(--ground), rgba(15, 23, 42, 0)) right center / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(129, 140, 248, 0.5), rgba(129, 140, 248, 0)) left center / 18px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(129, 140, 248, 0.5), rgba(129, 140, 248, 0)) right center / 18px 100% no-repeat scroll;
}

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

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 22px 0;
}

.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

/* A value the operator must replace before this page is published or sent to
   Google. Loud on purpose — a placeholder that reads as finished text is how a
   policy ships saying "[Company]". */
.todo {
  background: var(--warn-ground);
  border: 1px dashed var(--warn-rule);
  color: var(--warn-ink);
  padding: 1px 7px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.92em;
}

footer {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

@media (max-width: 480px) {
  body { font-size: 14.5px; }
  header.masthead { padding-block: 36px 24px; }
}

/* ---- The "ask to join Community" form (community.html) ----------------- */

.join-form { display: grid; gap: 16px; margin: 24px 0; }

.join-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }

.join-form .hint { font-weight: 400; color: var(--ink-faint); font-size: 13px; }

.join-form input,
.join-form textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px 12px;
}

.join-form textarea { min-height: 110px; resize: vertical; }

.join-form input:focus-visible,
.join-form textarea:focus-visible,
.join-form button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.join-form button {
  justify-self: start;
  min-height: 44px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--accent-deep);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.join-form button:hover { background: #4338ca; }

/* Off-screen for people, there for bots: a request that fills it is dropped. */
.join-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* The page has no script. The server sends people back to #sent or
   #error-<field>, and only the matching message shows. */
.join-msg { display: none; }
.join-msg:target { display: block; }
.join-msg.ok { border-color: rgba(52, 211, 153, 0.4); }
.join-msg.bad { background: var(--warn-ground); border-color: var(--warn-rule); color: var(--warn-ink); }
