/*
 * The public site, in the dashboard's tokens (DESIGN_LANGUAGE.md section 3). Dark by default,
 * light when the system asks for it. No scripts, so the system setting is the only switch.
 * Font URLs are replaced with their hashed paths when the site starts (src/assets.ts).
 */
@font-face {
  font-family: "Atkinson Hyperlegible Next Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/assets/sans.18b2a1a39a2f.woff2") format("woff2-variations");
}

@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/assets/mono.18be452724bf.woff2") format("woff2-variations");
}

:root {
  --bg: #141017;
  --surface: #1c1720;
  --surface-2: #241e29;
  --border: #342c3a;
  --border-strong: #73667a;
  --text: #f3eef4;
  --text-muted: #a99fad;
  --accent: #ff66aa;
  --on-accent: #1a0f15;
  --info: #5bcefa;
  --soft: #f5a9b8;
  --stripe-blue: #5bcefa;
  --stripe-pink: #f5a9b8;
  --stripe-white: #ffffff;
  --motion-fast: 150ms;
  --sans: "Atkinson Hyperlegible Next Variable", system-ui, sans-serif;
  --mono: "JetBrains Mono Variable", ui-monospace, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbf8fb;
    --surface: #ffffff;
    --surface-2: #f4eff4;
    --border: #e3dae4;
    --border-strong: #8e8293;
    --text: #1e1621;
    --text-muted: #665a6b;
    --accent: #be2878;
    --on-accent: #ffffff;
    --info: #146c96;
    --soft: #b5536a;
    /* The white band would vanish on a white page. */
    --stripe-white: #e3dae4;
    color-scheme: light;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0ms;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px / 1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 16px;
}

p {
  margin: 0;
}

a {
  color: var(--info);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

code,
.mono {
  font-family: var(--mono);
  font-size: 0.875em;
  font-variant-numeric: tabular-nums;
}

code {
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 4px;
  overflow-wrap: anywhere;
}

.num {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 14px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 6px;
  font-weight: 600;
  z-index: 1;
}

.skip:focus {
  top: 12px;
}

/* The brand mark: five flat bands, blue, pink, white, pink, blue. The only decoration. */
.stripe {
  height: 3px;
  background: linear-gradient(
    to right,
    var(--stripe-blue) 0 20%,
    var(--stripe-pink) 20% 40%,
    var(--stripe-white) 40% 60%,
    var(--stripe-pink) 60% 80%,
    var(--stripe-blue) 80% 100%
  );
}

.wrap {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 16px;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

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

.brand img {
  border-radius: 6px;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

.top nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.top nav a:hover,
.top nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
}

main section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

main section:first-child {
  border-top: 0;
  padding-top: 8px;
}

main section > * + * {
  margin-top: 16px;
}

.banner {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.lead {
  font-size: 20px;
  max-width: 38rem;
}

.prose {
  max-width: 40rem;
}

.prose > * + * {
  margin-top: 12px;
}

.join {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-top: 8px;
}

.button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transition: filter var(--motion-fast) ease-out;
}

.button:hover {
  filter: brightness(1.08);
}

/* Rules: section titles with their rules underneath, two columns when there is room. */
.rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 24px 32px;
}

.rules ul,
.plain-list {
  margin: 8px 0 0;
  padding-left: 20px;
}

.rules li + li,
.plain-list li + li {
  margin-top: 6px;
}

.rules li::marker {
  color: var(--soft);
}

/* Tables: the team numbers and the privacy table. */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

caption {
  text-align: left;
  padding: 12px 16px 0;
  color: var(--text-muted);
  font-size: 14px;
}

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

thead th {
  border-top: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

td.num,
th.num {
  text-align: right;
  white-space: nowrap;
}

.team-name {
  font-weight: 600;
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 13px;
}

.kind {
  display: block;
  color: var(--text-muted);
  font-size: 14px;
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 24px 32px;
}

.columns > div > * + * {
  margin-top: 10px;
}

.address {
  display: inline-block;
  font-family: var(--mono);
  font-size: 14px;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 6px;
  overflow-wrap: anywhere;
}

footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--text-muted);
  font-size: 14px;
}

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

/* The privacy document. */
.doc h2 {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.doc h3 {
  margin-top: 24px;
}

.doc p,
.doc ul,
.doc ol {
  margin-top: 12px;
  max-width: 40rem;
}

.doc li + li {
  margin-top: 6px;
}

.doc .table-wrap {
  margin-top: 16px;
}

.doc table {
  font-size: 14px;
}

.doc td:first-child {
  font-weight: 600;
}

/* Narrow screens: each row of the privacy table becomes a short labelled list. */
@media (max-width: 40rem) {
  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 20px;
  }

  .lead {
    font-size: 18px;
  }

  th,
  td {
    padding: 8px 12px;
  }

  .doc thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .doc tr {
    display: block;
    padding: 8px 0;
    border-top: 1px solid var(--border);
  }

  .doc tbody tr:first-child {
    border-top: 0;
  }

  .doc td {
    display: block;
    border-top: 0;
    padding: 2px 12px;
  }

  .doc td:not(:first-child)::before {
    content: attr(data-label) ": ";
    color: var(--text-muted);
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
